:root {
  color-scheme: light;
  --ink: #20304a;
  --muted: #718095;
  --paper: #fffdf8;
  --cream: #fff8e9;
  --line: #e8e4dc;
  --coral: #ff755b;
  --coral-dark: #e85b44;
  --mint: #7bcdb1;
  --sky: #76b9ec;
  --sun: #f2c34e;
  --violet: #9881e8;
  --rose: #ee8eac;
  --good: #248665;
  --bad: #ce4f4f;
  --shadow: 0 18px 50px rgba(68, 57, 38, 0.11);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: #f3efe8; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 193, 111, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 42%, rgba(123, 205, 177, 0.14), transparent 25rem),
    #f3efe8;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(78, 124, 232, 0.32); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.offline-banner {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 28px);
  transform: translateX(-50%);
  padding: 9px 14px;
  border-radius: 999px;
  color: #725b2d;
  background: #fff0bf;
  box-shadow: 0 8px 22px rgba(81, 65, 34, 0.15);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  box-shadow: 0 0 70px rgba(44, 36, 25, 0.13);
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 20px 10px;
  background: rgba(255, 253, 248, 0.94);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 15px 15px 15px 5px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #ff9d68, var(--coral));
  box-shadow: 0 7px 16px rgba(255, 117, 91, 0.25);
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: 1.25rem;
  transform: rotate(-3deg);
}
.brand b, .brand small { display: block; }
.brand b { font-size: 0.97rem; letter-spacing: 0.02em; }
.brand small { color: var(--muted); font-size: 0.68rem; margin-top: 2px; }

.profile-button, .icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 5px 12px rgba(47, 44, 37, 0.05);
}

.main-content { padding: 16px 20px 30px; }
.view { animation: view-in 0.25s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } }

.course-switcher {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 18px;
  padding: 13px 15px;
  border: 1px solid #f0dfca;
  border-radius: 19px;
  color: var(--ink);
  background: #fff8ed;
  text-align: left;
}
.course-switcher span { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 9px; }
.course-switcher small { grid-column: 1 / -1; margin-bottom: 2px; color: #a16c3d; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.08em; }
.course-switcher b { font-size: 0.98rem; }
.course-switcher em { color: var(--muted); font-size: 0.68rem; font-style: normal; }
.course-switcher i { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--coral-dark); background: white; font-size: 1rem; font-style: normal; }

.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 6px 0 22px; }
.eyebrow { margin: 0 0 6px; color: var(--coral-dark); font-size: 0.68rem; letter-spacing: 0.13em; font-weight: 900; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.45rem, 6vw, 1.85rem); letter-spacing: -0.04em; line-height: 1.2; }
h2 { letter-spacing: -0.025em; }

.streak-pill {
  min-width: 65px;
  padding: 9px 8px 7px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #fff3de;
  border: 1px solid #f4e0bb;
}
.streak-pill b { font-size: 1.05rem; }
.streak-pill small { grid-column: 1 / -1; color: #9a7542; font-size: 0.62rem; text-align: center; }

.daily-card {
  min-height: 280px;
  border-radius: 30px;
  color: white;
  background: linear-gradient(145deg, #ff8d67 0%, #ff6657 62%, #eb514d 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 34px rgba(230, 84, 71, 0.24);
}
.daily-card::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  right: -85px;
  top: -95px;
}
.daily-copy { position: relative; z-index: 2; max-width: 315px; }
.tag {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.17);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.daily-card h2 { margin: 15px 0 6px; font-size: 1.62rem; }
.daily-card p { margin: 0; color: rgba(255,255,255,0.87); font-size: 0.87rem; line-height: 1.65; }
.daily-progress { display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; }
.daily-progress > span { width: 140px; height: 7px; border-radius: 999px; background: rgba(84, 30, 30, 0.2); overflow: hidden; }
.daily-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: white; transition: width 0.35s; }
.daily-progress b { font-size: 0.72rem; }

.daily-art { position: absolute; right: -2px; bottom: 4px; width: 145px; height: 145px; opacity: 0.82; }
.art-spark { position: absolute; font-size: 5.2rem; right: 22px; bottom: 8px; color: #ffd98c; filter: drop-shadow(0 8px 8px rgba(109, 42, 30, 0.14)); }
.art-orbit { position: absolute; border: 2px solid rgba(255,255,255,0.24); border-radius: 50%; transform: rotate(-28deg); }
.orbit-one { width: 130px; height: 44px; right: 0; bottom: 35px; }
.orbit-two { width: 84px; height: 28px; right: 23px; bottom: 43px; transform: rotate(28deg); }

.primary-button, .secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 12px 17px;
  font-weight: 850;
  transition: transform 0.15s, opacity 0.15s;
}
.primary-button:active, .secondary-button:active { transform: scale(0.98); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; color: var(--coral-dark); background: white; box-shadow: 0 8px 18px rgba(117, 40, 35, 0.15); }
.primary-button > span { font-size: 1.1rem; }
.secondary-button { color: var(--ink); background: white; border: 1px solid var(--line); }
.full-button { width: 100%; }

.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 1.28rem; }
.term-badge { border-radius: 12px; padding: 7px 10px; color: #9b6a2d; background: #fff0d6; font-size: 0.75rem; font-weight: 850; }

.unit-list { display: grid; gap: 14px; }
.unit-card { border: 1px solid var(--line); border-radius: 23px; background: white; overflow: hidden; box-shadow: 0 8px 22px rgba(57, 52, 43, 0.045); }
.unit-cover { display: block; width: 100%; aspect-ratio: 3 / 1.55; object-fit: cover; object-position: center; background: #f6ead7; }
.unit-summary { width: 100%; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 13px; padding: 16px; border: 0; color: inherit; background: transparent; text-align: left; }
.unit-symbol { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 17px; color: white; font-size: 1.25rem; background: var(--unit-color); }
.unit-summary h3 { margin: 0; font-size: 1rem; }
.unit-summary p { margin: 4px 0 0; color: var(--muted); font-size: 0.75rem; }
.unit-status { color: var(--muted); font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.unit-card.locked { opacity: 0.7; }
.unit-card.locked .unit-symbol { filter: saturate(0.55); }
.unit-card.unit-complete { border-color: color-mix(in srgb, var(--unit-color) 35%, var(--line)); box-shadow: 0 12px 30px color-mix(in srgb, var(--unit-color) 11%, transparent); }

.lesson-path { padding: 4px 16px 18px 40px; }
.lesson-node { width: 100%; min-height: 58px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; border: 0; background: none; text-align: left; color: inherit; padding: 4px 0; position: relative; }
.lesson-node:not(:last-child)::after { content: ""; width: 2px; height: 18px; background: #e7e2d9; position: absolute; left: 16px; bottom: -7px; }
.node-dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #e6e1d8; color: #9b968d; background: #faf8f3; font-size: 0.75rem; font-weight: 900; }
.lesson-node.current .node-dot { color: white; border-color: var(--coral); background: var(--coral); box-shadow: 0 0 0 6px #fff0eb; }
.lesson-node.complete .node-dot { color: white; border-color: var(--mint); background: var(--mint); }
.lesson-node.locked { cursor: default; opacity: 0.5; }
.node-copy b, .node-copy small { display: block; }
.node-copy b { font-size: 0.84rem; }
.node-copy small { margin-top: 3px; color: var(--muted); font-size: 0.68rem; }
.node-stars { color: #f2b739; letter-spacing: 1px; font-size: 0.76rem; }
.unit-finale { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; margin: 0 16px 16px; padding: 12px; border-radius: 17px; background: #f6f4ef; }
.unit-finale.ready { color: #6f4b16; background: #fff3d5; }
.unit-finale.complete { color: #2f6b57; background: #e9f7f1; }
.unit-finale.locked { opacity: 0.66; }
.unit-finale-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: white; font-size: 1.15rem; }
.unit-finale b, .unit-finale small { display: block; }
.unit-finale b { font-size: 0.76rem; }
.unit-finale small { margin-top: 3px; color: currentColor; opacity: 0.72; font-size: 0.63rem; line-height: 1.4; }
.unit-finale button, .unit-retry-button { min-height: 38px; border: 0; border-radius: 12px; padding: 8px 11px; color: white; background: var(--unit-color, var(--coral)); font-size: 0.68rem; font-weight: 850; }
.unit-finale button:disabled { color: #8f8a80; background: #e4e0d8; }

.page-heading { margin: 8px 0 24px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading > p:last-child { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.empty-card { padding: 30px 22px; border-radius: 25px; text-align: center; background: var(--cream); border: 1px solid #f1e6ce; }
.empty-visual { width: 90px; height: 90px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 30px; background: white; font-size: 2.4rem; transform: rotate(-4deg); box-shadow: 0 10px 25px rgba(81, 67, 39, 0.08); }
.empty-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.empty-card p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.empty-card .secondary-button { margin-top: 18px; }

.review-list { display: grid; gap: 11px; margin-bottom: 18px; }
.review-item { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.review-item-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #fff0ec; color: var(--coral-dark); font-weight: 900; }
.review-item b, .review-item small { display: block; }
.review-item small { color: var(--muted); margin-top: 3px; font-size: 0.7rem; }

.growth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.growth-stat { padding: 18px; border-radius: 21px; background: white; border: 1px solid var(--line); }
.growth-stat span { display: block; font-size: 1.45rem; margin-bottom: 12px; }
.growth-stat b { display: block; font-size: 1.25rem; }
.growth-stat small { color: var(--muted); font-size: 0.72rem; }
.report-card { display: flex; gap: 15px; margin: 18px 0; padding: 19px; border-radius: 24px; background: #eef8f4; border: 1px solid #d7eee6; }
.report-card .tag { color: #397761; background: #d9eee7; }
.report-card h2 { margin: 9px 0 6px; font-size: 1rem; }
.report-card p { margin: 0; color: #607a71; font-size: 0.76rem; line-height: 1.55; }
.report-icon { font-size: 1.6rem; }
.unit-report-section { margin: 28px 0 18px; }
.unit-report-list { display: grid; gap: 13px; }
.unit-report-card { padding: 17px; border: 1px solid color-mix(in srgb, var(--unit-color) 28%, var(--line)); border-radius: 22px; background: white; box-shadow: 0 10px 26px color-mix(in srgb, var(--unit-color) 8%, transparent); }
.unit-report-heading { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; }
.unit-report-heading > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--unit-color); font-size: 1.2rem; }
.unit-report-heading small, .unit-report-heading h3 { display: block; margin: 0; }
.unit-report-heading small { color: var(--muted); font-size: 0.59rem; font-weight: 800; letter-spacing: 0.04em; }
.unit-report-heading h3 { margin-top: 4px; font-size: 0.94rem; }
.unit-report-heading > b { color: var(--unit-color); font-size: 1.3rem; }
.unit-report-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0; }
.unit-report-metrics span { padding: 10px 7px; border-radius: 13px; text-align: center; background: #f7f5f0; }
.unit-report-metrics b, .unit-report-metrics small { display: block; }
.unit-report-metrics b { font-size: 0.9rem; }
.unit-report-metrics small { margin-top: 3px; color: var(--muted); font-size: 0.6rem; }
.unit-report-card > p { color: var(--muted); font-size: 0.73rem; line-height: 1.6; }
.unit-report-card .secondary-button { min-height: 42px; margin-top: 4px; font-size: 0.72rem; }

.pilot-card { margin: 18px 0; padding: 19px; border-radius: 24px; background: #f7f4ff; border: 1px solid #e5def8; }
.pilot-heading { display: flex; align-items: center; gap: 13px; }
.pilot-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: white; background: var(--violet); font-size: 1.8rem; }
.pilot-card .tag { color: #6852a8; background: #eae4fa; }
.pilot-card h2 { margin: 7px 0 0; font-size: 1rem; }
.pilot-card > p { margin: 14px 0; color: #706884; font-size: 0.76rem; line-height: 1.6; }
.pilot-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pilot-actions .secondary-button { min-height: 40px; padding: 8px 12px; font-size: 0.74rem; }
.sync-state { display: inline-flex; align-items: center; gap: 6px; color: #817992; font-size: 0.7rem; font-weight: 800; }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: #aaa4b4; }
.sync-state.enabled { color: #32755f; }
.sync-state.enabled i { background: #4fb58e; box-shadow: 0 0 0 4px rgba(79,181,142,.13); }
.privacy-link { display: inline-block; margin-top: 13px; color: #6f59aa; font-size: 0.7rem; font-weight: 800; text-decoration: none; }
.legal-links { display: flex; flex-wrap: wrap; gap: 0 16px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, 0.95);
  border-top: 1px solid rgba(224, 219, 210, 0.8);
  backdrop-filter: blur(18px);
}
.nav-item { min-height: 55px; border: 0; border-radius: 17px; color: #9a9aa0; background: transparent; position: relative; }
.nav-item span, .nav-item b { display: block; }
.nav-item span { font-size: 1.28rem; line-height: 1; }
.nav-item b { margin-top: 5px; font-size: 0.67rem; }
.nav-item.active { color: var(--coral-dark); background: #fff1ec; }
.nav-badge { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 1px 4px; border-radius: 999px; color: white; background: var(--coral); font-size: 0.58rem; font-style: normal; }

.lesson-screen { --lesson-accent: var(--coral); --lesson-soft: #fff0eb; position: fixed; inset: 0; z-index: 20; background: radial-gradient(circle at 88% 7%, color-mix(in srgb, var(--lesson-accent) 12%, transparent), transparent 17rem), var(--paper); overflow: auto; }
.lesson-screen[data-unit-color="mint"] { --lesson-accent: var(--mint); --lesson-soft: #eaf7f2; }
.lesson-screen[data-unit-color="sky"] { --lesson-accent: var(--sky); --lesson-soft: #eaf4fc; }
.lesson-screen[data-unit-color="sun"] { --lesson-accent: var(--sun); --lesson-soft: #fff7db; }
.lesson-screen[data-unit-color="violet"] { --lesson-accent: var(--violet); --lesson-soft: #f1edff; }
.lesson-screen[data-unit-color="rose"] { --lesson-accent: var(--rose); --lesson-soft: #fff0f5; }
.lesson-header { min-height: 72px; display: grid; grid-template-columns: 44px 1fr 54px; align-items: center; gap: 14px; width: min(100%, 650px); margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 18px 10px; }
.lesson-header .icon-button { font-size: 1.7rem; font-weight: 350; box-shadow: none; }
.lesson-progress { height: 10px; border-radius: 999px; background: #eeeae3; overflow: hidden; }
.lesson-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--lesson-accent) 68%, white), var(--lesson-accent)); transition: width 0.35s; }
.heart-counter { color: #f1b83e; text-align: right; white-space: nowrap; }
.heart-counter b { margin-left: 4px; color: var(--ink); }
.lesson-stage { width: min(100%, 650px); min-height: calc(100dvh - 172px); margin: 0 auto; padding: 32px 24px 24px; display: flex; flex-direction: column; justify-content: center; }
.lesson-footer { position: sticky; bottom: 0; width: 100%; padding: 14px max(20px, calc((100% - 610px) / 2)) calc(14px + env(safe-area-inset-bottom)); background: rgba(255,253,248,0.96); border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
.lesson-footer .primary-button { color: white; background: var(--lesson-accent); box-shadow: 0 8px 18px color-mix(in srgb, var(--lesson-accent) 30%, transparent); }
.lesson-footer .primary-button:disabled { opacity: 0.45; box-shadow: none; cursor: default; }

.activity { width: 100%; animation: activity-in 0.3s ease both; }
@keyframes activity-in { from { opacity: 0; transform: translateX(9px); } }
.activity-heading { text-align: center; margin-bottom: 22px; }
.activity-heading .eyebrow { margin-bottom: 8px; }
.activity-heading h1 { font-size: clamp(1.55rem, 6vw, 2.15rem); }
.activity-heading p { color: var(--muted); font-size: 0.83rem; line-height: 1.6; }
.lesson-context { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 13px; max-width: 440px; margin: 0 auto 24px; padding: 8px; border: 1px solid color-mix(in srgb, var(--lesson-accent) 22%, var(--line)); border-radius: 19px; text-align: left; background: rgba(255, 255, 255, 0.86); box-shadow: 0 10px 30px rgba(65, 57, 44, 0.06); }
.lesson-context img, .lesson-context-symbol { width: 70px; height: 55px; border-radius: 13px; object-fit: cover; }
.lesson-context-symbol { display: grid; place-items: center; color: white; background: var(--lesson-accent); font-size: 1.7rem; }
.lesson-context > span:last-child { min-width: 0; }
.lesson-context small, .lesson-context b, .lesson-context em { display: block; }
.lesson-context small { color: var(--lesson-accent); font-size: 0.58rem; font-weight: 900; letter-spacing: 0.08em; }
.lesson-context b { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.lesson-context em { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 0.67rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.story-visual, .word-visual { display: grid; place-items: center; margin: 0 auto 25px; background: linear-gradient(145deg, #fff0df, #ffe3d8); box-shadow: var(--shadow); }
.story-visual { width: 170px; height: 145px; border-radius: 50% 50% 45% 45%; position: relative; font-size: 3.2rem; }
.story-visual:not(.scene-visual)::after { content: ""; width: 65px; height: 12px; border-radius: 50%; background: rgba(83, 52, 40, 0.08); position: absolute; bottom: 17px; }
.scene-visual { display: block; width: min(100%, 520px); height: auto; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 28px; background: #ece6dc; transform: none; }
.scene-visual img { width: 100%; height: 100%; display: block; object-fit: cover; }
.scene-visual::before { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(transparent, rgba(22, 34, 49, 0.66)); pointer-events: none; }
.scene-visual figcaption { position: absolute; right: 19px; bottom: 16px; left: 19px; color: white; text-align: left; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28); }
.scene-visual figcaption span, .scene-visual figcaption b { display: block; }
.scene-visual figcaption span { font-size: 0.58rem; font-weight: 900; letter-spacing: 0.13em; }
.scene-visual figcaption b { margin-top: 3px; font-size: 1rem; }
.story-copy { padding: 18px; border: 1px solid var(--line); border-radius: 21px; background: white; }
.story-copy > p { margin: 0 0 14px; color: #536178; font-size: 0.82rem; line-height: 1.7; }
.lesson-objective { display: grid; gap: 5px; margin: 0 0 16px; padding: 13px 15px; border-radius: 17px; text-align: left; color: #49675e; background: #eaf7f2; }
.lesson-objective b { font-size: 0.72rem; }
.lesson-objective span { font-size: 0.79rem; line-height: 1.55; }
.reading-passage { margin: 16px 0; padding: 16px; border-radius: 17px; text-align: left; background: #f4f1ff; }
.reading-passage > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #6c58a9; font-size: 0.67rem; letter-spacing: 0.12em; }
.reading-passage .listen-inline { width: 36px; height: 36px; margin: 0; font-size: 0.9rem; }
.reading-passage p { margin: 0; color: #3f4e67; font-family: Georgia, "Times New Roman", serif; font-size: 0.93rem; line-height: 1.75; }
.dialogue-line { padding: 11px 12px; border-radius: 14px; background: #f8f6f1; margin-top: 9px; }
.dialogue-line b { color: var(--coral-dark); font-size: 0.7rem; }
.dialogue-line span, .dialogue-line small { display: block; }
.dialogue-line span { margin-top: 3px; font-weight: 800; }
.dialogue-line small { color: var(--muted); margin-top: 3px; }
.dialogue-line { border: 1px solid transparent; transition: 0.2s ease; }
.dialogue-line.is-speaking { border-color: color-mix(in srgb, var(--lesson-accent) 55%, white); background: var(--lesson-soft); box-shadow: 0 6px 18px color-mix(in srgb, var(--lesson-accent) 15%, transparent); transform: translateX(3px); }
.listen-inline { width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: var(--lesson-accent); margin-top: 13px; font-size: 1.1rem; }

.word-visual { width: 145px; height: 145px; border-radius: 44px; font-size: 4rem; transform: rotate(-2deg); }
.word-card { text-align: center; }
.word-card h1 { font-size: clamp(2.5rem, 11vw, 4rem); margin: 0; color: var(--ink); }
.word-card .meaning { margin: 5px 0 18px; color: var(--coral-dark); font-size: 1rem; font-weight: 800; }
.example-bubble { max-width: 380px; margin: 0 auto; padding: 13px 16px; border-radius: 16px; color: #59677b; background: #f5f3ee; font-size: 0.83rem; }

.speaker-button { width: 78px; height: 78px; display: grid; place-items: center; margin: 12px auto 25px; border: 0; border-radius: 50%; color: white; background: var(--lesson-accent); font-size: 1.8rem; box-shadow: 0 0 0 12px var(--lesson-soft), 0 15px 30px color-mix(in srgb, var(--lesson-accent) 25%, transparent); }
.speaker-button.playing { animation: speaker-pulse 0.7s ease; }
@keyframes speaker-pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 20px var(--lesson-soft); } }
.choice-list { display: grid; gap: 11px; margin-top: 22px; }
.choice-option { min-height: 57px; padding: 13px 16px; border: 1.5px solid #e2ded6; border-radius: 17px; color: var(--ink); background: white; text-align: left; font-weight: 750; }
.choice-option.selected { border-color: var(--coral); background: #fff2ee; }
.choice-option.correct { color: var(--good); border-color: #74c4a6; background: #edf9f4; }
.choice-option.wrong { color: var(--bad); border-color: #e1a0a0; background: #fff0f0; }
.feedback-box { margin-top: 18px; padding: 14px 16px; border-radius: 17px; font-size: 0.8rem; line-height: 1.55; }
.feedback-box.good { color: #276d57; background: #e9f7f1; }
.feedback-box.bad { color: #9a4242; background: #fff0f0; }

.spell-field { margin-top: 24px; }
.spell-field input { width: 100%; min-height: 63px; border: 2px solid #e2ded6; border-radius: 18px; padding: 13px 18px; text-align: center; color: var(--ink); background: white; font-size: 1.35rem; letter-spacing: 0.06em; }
.spell-hint { text-align: center; color: var(--muted); font-size: 1rem; letter-spacing: 0.08em; }
.speak-card { padding: 22px 20px; border-radius: 28px; text-align: center; background: linear-gradient(155deg, white, var(--lesson-soft)); border: 1px solid color-mix(in srgb, var(--lesson-accent) 25%, var(--line)); box-shadow: 0 18px 45px color-mix(in srgb, var(--lesson-accent) 10%, transparent); }
.speak-model-row, .recording-heading { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; text-align: left; }
.speak-model-row > span:nth-child(2) b, .speak-model-row > span:nth-child(2) small, .recording-heading > span:last-child b, .recording-heading > span:last-child small { display: block; }
.speak-model-row small, .recording-heading small { margin-top: 3px; color: var(--muted); font-size: 0.66rem; line-height: 1.45; }
.practice-step { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--lesson-accent); font-size: 0.72rem; font-weight: 900; }
.practice-audio-button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: var(--lesson-accent); font-size: 0.9rem; box-shadow: 0 8px 18px color-mix(in srgb, var(--lesson-accent) 24%, transparent); }
.practice-audio-button.playing, .listen-inline.playing { animation: speaker-pulse 0.8s ease infinite; }
.speak-phrase { margin: 22px 0 0; font-size: clamp(1.35rem, 6vw, 1.9rem); font-weight: 900; line-height: 1.45; }
.speak-tip { margin: 13px 0 0; color: #826b5b; font-size: 0.78rem; line-height: 1.6; }
.recording-practice { margin-top: 22px; padding-top: 20px; border-top: 1px dashed color-mix(in srgb, var(--lesson-accent) 35%, var(--line)); }
.recording-heading { grid-template-columns: 32px 1fr; }
.recording-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 17px; }
.record-button { min-height: 45px; padding: 10px 16px; border: 0; border-radius: 999px; color: white; background: var(--lesson-accent); font-size: 0.75rem; font-weight: 850; box-shadow: 0 7px 18px color-mix(in srgb, var(--lesson-accent) 22%, transparent); }
.record-button.stop { background: #d95454; }
.record-button.replay { background: #465e86; }
.record-button.secondary { color: var(--ink); border: 1px solid var(--line); background: white; box-shadow: none; }
.record-button:disabled { cursor: default; opacity: 0.45; box-shadow: none; }
.recording-meter { height: 30px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 14px auto -2px; }
.recording-meter i { width: 5px; height: 10px; border-radius: 999px; background: #d95454; animation: recording-wave 0.65s ease-in-out infinite alternate; }
.recording-meter i:nth-child(2), .recording-meter i:nth-child(4) { animation-delay: -0.25s; }
.recording-meter i:nth-child(3) { animation-delay: -0.42s; }
@keyframes recording-wave { to { height: 27px; } }
.recording-practice[data-state="error"] .recording-heading small { color: #a34d4d; }

.completion-card { text-align: center; }
.completion-cover { width: min(100%, 360px); aspect-ratio: 16 / 8; display: block; margin: 0 auto 20px; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); }
.completion-stars { font-size: 2.5rem; letter-spacing: 5px; color: #efb83e; animation: star-in 0.55s ease both; }
@keyframes star-in { from { opacity: 0; transform: scale(0.55) rotate(-10deg); } }
.completion-card h1 { margin: 18px 0 8px; font-size: 2rem; }
.completion-card p { color: var(--muted); line-height: 1.65; }
.completion-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.completion-stat { padding: 16px; border-radius: 19px; background: #f7f5f0; }
.completion-stat b, .completion-stat small { display: block; }
.completion-stat b { font-size: 1.35rem; }
.completion-stat small { margin-top: 4px; color: var(--muted); font-size: 0.7rem; }
.lesson-recap { margin-top: 18px; padding: 17px; border-radius: 20px; text-align: left; background: #f5f3ee; }
.lesson-recap > b { display: block; margin-bottom: 12px; font-size: 0.84rem; }
.lesson-recap p { margin: 11px 0 7px; color: var(--muted); font-size: 0.68rem; font-weight: 800; }
.lesson-recap div { display: flex; flex-wrap: wrap; gap: 7px; }
.lesson-recap span { padding: 6px 9px; border-radius: 999px; color: #855144; background: #ffe8df; font-size: 0.73rem; font-weight: 850; }
.lesson-recap blockquote { margin: 0; padding: 11px 13px; border-left: 3px solid var(--coral); border-radius: 0 12px 12px 0; color: #435169; background: white; font-size: 0.8rem; line-height: 1.55; }
.unit-completion-card { width: 100%; text-align: center; }
.unit-completion-card h1 { margin: 10px 0 8px; font-size: clamp(1.75rem, 7vw, 2.3rem); }
.unit-completion-card > p:not(.eyebrow) { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 0.84rem; line-height: 1.65; }
.unit-award { width: 142px; min-height: 142px; display: grid; place-items: center; align-content: center; margin: -54px auto 18px; border: 7px solid var(--paper); border-radius: 50%; color: #7b571d; background: radial-gradient(circle at 32% 24%, #fffbe8, #ffd96f); box-shadow: 0 15px 35px rgba(167, 116, 30, 0.2); transform: rotate(-3deg); }
.unit-award span { font-size: 2.6rem; }
.unit-award small, .unit-award b { display: block; }
.unit-award small { margin-top: 3px; font-size: 0.52rem; font-weight: 900; letter-spacing: 0.1em; }
.unit-award b { margin-top: 3px; font-size: 0.9rem; }
.unit-completion-stats { grid-template-columns: repeat(3, 1fr); }
.unit-mastery, .unit-parent-summary, .next-unit-preview { margin-top: 18px; padding: 17px; border-radius: 21px; text-align: left; }
.unit-mastery { background: #f7f4ff; }
.unit-mastery > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.unit-mastery > div:first-child b, .unit-mastery > div:first-child small { display: block; }
.unit-mastery > div:first-child b { font-size: 0.84rem; }
.unit-mastery > div:first-child small { color: #756b90; font-size: 0.63rem; }
.mastery-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.mastery-tags span { padding: 6px 9px; border-radius: 999px; color: #654f9d; background: white; font-size: 0.7rem; font-weight: 850; }
.mastery-expressions { display: grid; gap: 7px; margin-top: 12px; }
.mastery-expressions blockquote { margin: 0; padding: 10px 12px; border-left: 3px solid var(--violet); border-radius: 0 12px 12px 0; color: #45506a; background: white; font-size: 0.72rem; line-height: 1.5; }
.unit-parent-summary { display: grid; grid-template-columns: 42px 1fr; gap: 12px; background: #eef8f4; border: 1px solid #d7eee6; }
.unit-parent-summary > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: white; font-size: 1.25rem; }
.unit-parent-summary small, .unit-parent-summary b { display: block; }
.unit-parent-summary small { color: #4c806e; font-size: 0.61rem; font-weight: 850; }
.unit-parent-summary b { margin-top: 4px; font-size: 0.8rem; }
.unit-parent-summary p { margin: 6px 0 0; color: #607a71; font-size: 0.7rem; line-height: 1.55; }
.next-unit-preview { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 13px; color: white; background: color-mix(in srgb, var(--lesson-accent) 84%, #26334a); }
.next-unit-preview img, .next-unit-preview > span { width: 92px; height: 72px; border-radius: 15px; object-fit: cover; }
.next-unit-preview > span { display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 1.8rem; }
.next-unit-preview small, .next-unit-preview b { display: block; }
.next-unit-preview small { color: rgba(255,255,255,.7); font-size: 0.56rem; font-weight: 900; letter-spacing: 0.1em; }
.next-unit-preview b { margin-top: 4px; font-size: 0.84rem; }
.next-unit-preview p { margin: 5px 0 0; color: rgba(255,255,255,.78); font-size: 0.67rem; line-height: 1.45; }
.next-unit-preview.course-complete { grid-template-columns: 58px 1fr; }
.next-unit-preview.course-complete > span { width: 58px; height: 58px; }
.unit-retry-button { margin-top: 17px; color: var(--lesson-accent); border: 1px solid color-mix(in srgb, var(--lesson-accent) 35%, var(--line)); background: white; }
.unit-completion-actions { display: grid; grid-template-columns: minmax(118px, .55fr) minmax(180px, 1fr); gap: 10px; }
.unit-completion-actions .secondary-button { background: white; }
.unit-completion-actions .primary-button { width: 100%; }

.modal { max-width: none; width: 100%; height: 100%; margin: 0; border: 0; padding: 20px; background: rgba(38, 43, 51, 0.37); }
.modal[open] { display: grid; place-items: center; animation: modal-bg 0.2s ease both; }
.modal::backdrop { background: transparent; }
@keyframes modal-bg { from { opacity: 0; } }
.modal-card { width: min(100%, 410px); max-height: 90dvh; overflow: auto; padding: 29px 24px 24px; border-radius: 28px; text-align: center; background: var(--paper); box-shadow: 0 25px 70px rgba(31, 32, 37, 0.2); position: relative; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: #f1efea; font-size: 1.35rem; }
.modal-icon { font-size: 2.5rem; margin-bottom: 13px; }
.modal-card h2 { margin: 0 0 9px; }
.modal-card > p:not(.eyebrow) { color: var(--muted); font-size: 0.84rem; line-height: 1.6; }
.answer-field { display: grid; gap: 7px; text-align: left; margin: 20px 0 5px; }
.answer-field span { color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.answer-field input { min-height: 50px; border: 1px solid var(--line); border-radius: 15px; padding: 10px 13px; font-size: 1.1rem; }
.form-error { min-height: 20px; margin: 4px 0 !important; color: var(--bad) !important; }
.modal-card .primary-button { color: white; background: var(--coral); }
.paywall-art { width: 95px; height: 95px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 34px; color: #e49928; background: #fff0c9; font-size: 3rem; transform: rotate(-5deg); }
.benefit-list { display: grid; gap: 10px; margin: 19px 0; padding: 0; text-align: left; list-style: none; }
.benefit-list li { display: flex; gap: 10px; align-items: center; font-size: 0.82rem; }
.benefit-list span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--good); background: #e6f5ef; font-weight: 900; }
.paywall-card > small { display: block; margin-top: 11px; color: var(--muted); font-size: 0.65rem; }
.course-picker-card { text-align: left; }
.course-picker-card > p:not(.eyebrow) { margin: 0 0 17px; }
.edition-options { display: grid; gap: 9px; margin-bottom: 13px; }
.edition-option { min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: white; font-weight: 850; text-align: left; }
.edition-option small { display: block; margin-top: 3px; color: #718096; font-size: 0.68rem; font-weight: 650; }
.edition-option.selected { color: var(--coral-dark); border-color: #f0a18f; background: #fff0eb; box-shadow: 0 0 0 3px rgba(255, 117, 91, 0.1); }
.grade-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.term-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 9px; }
.grade-option, .term-option { min-height: 56px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: white; font-weight: 850; }
.grade-option.selected, .term-option.selected { color: var(--coral-dark); border-color: #f0a18f; background: #fff0eb; box-shadow: 0 0 0 3px rgba(255, 117, 91, 0.1); }
.grade-option:disabled, .term-option:disabled { color: #a8b0bc; background: #f5f3ee; cursor: not-allowed; }
.content-status { display: inline-flex; margin-left: 6px; padding: 2px 7px; border-radius: 999px; color: #9a5b00; background: #fff0c9; font-size: 0.64rem; font-weight: 850; vertical-align: 1px; }
.textbook-alignment { display: block; margin-top: 4px; color: #718096; font-size: 0.68rem; font-weight: 700; }
.course-preview { margin: 16px 0; padding: 14px 15px; border-radius: 17px; color: #5f6f83; background: #f5f3ee; font-size: 0.75rem; line-height: 1.6; }
.course-preview b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 0.86rem; }
.data-list { display: grid; gap: 10px; margin: 18px 0; padding: 0; text-align: left; list-style: none; }
.data-list li { padding: 10px 12px; border-radius: 13px; color: #687387; background: #f5f3ef; font-size: 0.75rem; line-height: 1.5; }
.data-list b { color: var(--ink); }
.consent-check { display: flex; gap: 9px; align-items: flex-start; margin: 17px 0 4px; text-align: left; color: #657185; font-size: 0.73rem; line-height: 1.55; }
.consent-check input { width: 19px; height: 19px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--coral); }
.consent-check a { color: var(--coral-dark); font-weight: 800; }
.consent-card .primary-button:disabled { cursor: default; opacity: 0.45; box-shadow: none; }
.consent-card > .secondary-button { margin-top: 10px; }
.consent-card > small { display: block; margin-top: 12px; color: var(--muted); font-size: 0.66rem; line-height: 1.55; }
.toast { position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 50; max-width: calc(100% - 40px); transform: translate(-50%, 15px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 999px; color: white; background: #26334a; font-size: 0.76rem; text-align: center; transition: 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .unit-finale { grid-template-columns: 38px 1fr; }
  .unit-finale button { grid-column: 1 / -1; width: 100%; }
  .unit-completion-stats { gap: 7px; }
  .unit-completion-stats .completion-stat { padding: 13px 7px; }
  .unit-mastery > div:first-child { display: block; }
  .unit-mastery > div:first-child small { margin-top: 4px; }
  .next-unit-preview { grid-template-columns: 72px 1fr; }
  .next-unit-preview img, .next-unit-preview > span { width: 72px; height: 64px; }
  .unit-completion-actions { grid-template-columns: 1fr; }
}

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100dvh - 48px); border-radius: 34px; overflow: hidden; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
