:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --paper: #fffdf8;
  --ink: #202124;
  --muted: #6c6f75;
  --line: #dfd8cc;
  --accent: #16716a;
  --accent-strong: #0f5852;
  --warm: #d97731;
  --blue: #2f5e9e;
  --red: #b94a48;
  --shadow: 0 18px 40px rgba(43, 34, 19, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #202124;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3c96b;
  color: #202124;
  font-weight: 800;
}

.brand h1 {
  font-size: 17px;
  margin: 0;
  letter-spacing: 0;
}

.brand p {
  margin: 3px 0 0;
  color: #c7c3bb;
  font-size: 13px;
}

.profile-list {
  display: grid;
  gap: 8px;
}

.profile-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: white;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.profile-button:hover,
.profile-button.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(243, 201, 107, 0.7);
  transform: translateY(-1px);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #151515;
}

.profile-meta strong {
  display: block;
  font-size: 15px;
}

.profile-meta span,
.profile-level {
  color: #c7c3bb;
  font-size: 12px;
}

.parent-summary {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.sync-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 16px;
}

.summary-title {
  color: #f3c96b;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.compact-kid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  color: #e9e3d8;
  font-size: 13px;
}

.code-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  padding: 0 10px;
  margin-bottom: 8px;
}

.code-input::placeholder {
  color: #a8a39a;
}

.code-input.light {
  min-width: 180px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.home-sync-panel {
  display: grid;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.home-sync-panel h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.home-sync-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.home-sync-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.sync-button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f3c96b;
  color: #202124;
  font-weight: 800;
}

#syncStatus {
  margin: 8px 0 0;
  color: #c7c3bb;
  font-size: 12px;
  line-height: 1.4;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: var(--red);
}

.status-dot.done {
  background: #49b47d;
}

.workspace {
  padding: 26px 34px 42px;
  min-width: 0;
}

.task-mode .app-shell,
.tasks-mode .app-shell,
.home-mode .app-shell {
  display: block;
}

.task-mode .sidebar,
.tasks-mode .sidebar,
.home-mode .sidebar {
  display: none;
}

.task-mode .workspace,
.tasks-mode .workspace,
.home-mode .workspace {
  padding: 0 0 86px;
}

.tasks-mode .workspace,
.home-mode .workspace {
  padding: 16px;
}

.family-home {
  display: grid;
  gap: 14px;
}

.family-home[hidden] {
  display: none;
}

.home-hero {
  background: #202124;
  color: white;
  border-radius: 8px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.home-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.light-hero-button {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.home-hero .eyebrow {
  color: #f3c96b;
}

.home-hero h3 {
  margin: 0;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1.05;
}

.home-hero p:last-child {
  margin: 8px 0 0;
  color: #d6d1c8;
}

.home-member-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-member {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 7px;
  text-align: left;
}

.home-member.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 113, 106, 0.12);
}

.home-member strong {
  font-size: 20px;
}

.home-member small,
.home-member span {
  color: var(--muted);
  line-height: 1.35;
}

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

.home-summary-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.home-summary-card span,
.home-summary-card p {
  color: var(--muted);
}

.home-summary-card strong {
  display: block;
  font-size: 34px;
  margin: 5px 0;
}

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

.eyebrow,
.role-label,
.prompt-label {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.date-pill {
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.version-pill {
  white-space: nowrap;
  background: #202124;
  color: white;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 230px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  overflow: hidden;
}

.hero-copy {
  padding: 34px;
  align-self: center;
}

.hero-copy h3 {
  margin: 0;
  font-size: clamp(26px, 3.5vw, 42px);
  line-height: 1.08;
  max-width: 760px;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.learning-scene {
  position: relative;
  min-height: 230px;
  background:
    linear-gradient(135deg, rgba(22, 113, 106, 0.14), rgba(243, 201, 107, 0.18)),
    #e9efe7;
  overflow: hidden;
}

.scene-sun {
  position: absolute;
  width: 96px;
  height: 96px;
  right: 34px;
  top: 28px;
  border-radius: 50%;
  background: #f3c96b;
  box-shadow: 0 0 0 18px rgba(243, 201, 107, 0.14);
}

.scene-book {
  position: absolute;
  left: 50px;
  bottom: 34px;
  width: 190px;
  height: 92px;
  border-radius: 8px 8px 18px 18px;
  background: linear-gradient(90deg, #fef8e5 49%, #efe5c8 50%);
  border: 5px solid #202124;
  transform: rotate(-5deg);
}

.scene-book::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: #202124;
  transform: translateX(-50%);
}

.scene-phone {
  position: absolute;
  right: 82px;
  bottom: 30px;
  width: 92px;
  height: 150px;
  border-radius: 18px;
  background: #202124;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.18);
}

.scene-phone::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 12px;
  background: linear-gradient(#fffdf8 0 34%, #d7e7e3 34% 58%, #f3c96b 58% 100%);
}

.scene-card {
  position: absolute;
  padding: 9px 12px;
  border-radius: 8px;
  background: white;
  border: 3px solid #202124;
  font-weight: 900;
  box-shadow: 7px 7px 0 rgba(32, 33, 36, 0.16);
}

.scene-card-a {
  left: 78px;
  top: 32px;
  color: var(--blue);
}

.scene-card-b {
  left: 220px;
  top: 78px;
  color: var(--accent);
}

.scene-card-c {
  right: 172px;
  bottom: 54px;
  color: var(--warm);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.upgrade-panel {
  background: #202124;
  color: white;
  border-radius: 8px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.upgrade-panel .eyebrow {
  color: #f3c96b;
}

.upgrade-panel h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
}

.upgrade-panel p:last-child {
  margin: 8px 0 0;
  color: #d6d1c8;
  line-height: 1.5;
}

.upgrade-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.upgrade-panel .ghost-button {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.metric strong {
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: 0;
}

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

.task-screen {
  margin-top: 0;
}

.task-screen-head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.task-mode .task-screen-head {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-template-columns: auto 1fr;
  align-items: center;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: #202124;
  color: white;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.task-mode .task-screen-head .eyebrow,
.task-mode .task-screen-head p:last-child {
  color: #d6d1c8;
}

.app-back-button {
  min-width: 86px;
  background: #f3c96b;
  color: #202124;
}

.task-screen-head h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.task-screen-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.task-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.task-mode .task-screen {
  min-height: 100vh;
}

.task-mode .task-work-grid {
  padding: 14px;
}

.task-bottom-bar {
  display: none;
}

.task-mode .task-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 24px rgba(43, 34, 19, 0.12);
}

.task-mode .task-bottom-bar button {
  min-height: 48px;
}

.task-column,
.coach-panel,
.assessment-section,
.assessment-report,
.dashboard-section,
.visual-learning-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.assessment-section {
  margin: 0;
}

.assessment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.assessment-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.assessment-mode {
  border: 1px solid var(--line);
  background: #fffaf0;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
}

.assessment-mode.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 113, 106, 0.12);
}

.assessment-mode strong {
  display: block;
  margin-bottom: 5px;
}

.assessment-mode span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.assessment-quiz {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.assessment-quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.assessment-quiz-head h4 {
  margin: 0;
  font-size: 20px;
}

.assessment-quiz-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.assessment-quiz-head span {
  white-space: nowrap;
  color: var(--accent-strong);
  font-weight: 900;
}

.assessment-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px;
}

.assessment-question p {
  margin: 0 0 9px;
  font-weight: 900;
  line-height: 1.45;
}

.assessment-options {
  display: grid;
  gap: 7px;
}

.assessment-options label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2eee6;
  padding: 9px 10px;
  cursor: pointer;
}

.assessment-question small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.assessment-report {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 14px;
}

.assessment-level-card,
.assessment-source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 13px;
}

.assessment-level-card span {
  color: var(--muted);
  font-size: 12px;
}

.assessment-level-card strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
  color: var(--accent-strong);
}

.assessment-level-card p,
.assessment-source-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.skill-report-list {
  display: grid;
  gap: 9px;
}

.skill-row {
  display: grid;
  grid-template-columns: 54px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}

.skill-meter {
  height: 9px;
  background: #e5ded2;
  border-radius: 99px;
  overflow: hidden;
}

.skill-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
}

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

.section-head.compact {
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

.task-lock {
  grid-column: 2 / -1;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.task-score {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.task-item.done {
  background: #eef7f2;
  border-color: rgba(22, 113, 106, 0.35);
}

.task-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #edf0ea;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--accent);
}

.task-main {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  min-width: 0;
}

.task-main h4 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: 0;
}

.task-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-main span {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.task-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.task-detail:empty {
  display: none;
}

.task-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.task-detail-head span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.task-detail-head h4 {
  margin: 0;
  font-size: 18px;
}

.task-detail p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
}

.task-goal {
  border-left: 4px solid var(--accent);
  background: #eef7f2;
  border-radius: 6px;
  padding: 10px 12px;
  color: #24423f;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 12px;
}

.task-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-vocab-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 8px;
  padding: 10px;
  align-items: center;
}

.task-vocab-card img {
  width: 132px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
}

.task-vocab-body {
  min-width: 0;
}

.task-vocab-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.task-vocab-head span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #edf0ea;
  color: var(--accent);
  font-weight: 900;
}

.task-vocab-head strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.phonetic-button {
  border: 0;
  background: #edf0ea;
  color: var(--accent-strong);
  border-radius: 6px;
  min-height: 30px;
  padding: 0 9px;
  margin: 6px 0;
  font-weight: 900;
}

.task-vocab-card p {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-weight: 900;
}

.task-vocab-card small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.task-vocab-card .sentence-zh {
  color: #38423f;
  margin-top: 3px;
}

.task-score-panel {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(22, 113, 106, 0.28);
  background: #f2f7f5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.task-score-panel strong {
  color: var(--accent-strong);
}

.task-score-panel span {
  color: var(--muted);
  line-height: 1.45;
}

.task-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.task-block h5 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--accent-strong);
}

.listening-block p,
.reading-block p {
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.task-practice-lines {
  display: grid;
  gap: 8px;
}

.practice-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  line-height: 1.45;
}

.line-english {
  display: inline;
  color: var(--ink);
  font-weight: 800;
}

.line-zh {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.line-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.word-chip {
  border: 1px solid rgba(22, 113, 106, 0.28);
  background: #edf0ea;
  color: var(--accent-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.task-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.mini-quiz {
  display: grid;
  gap: 10px;
}

.quiz-question {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.quiz-question p {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2eee6;
  color: var(--ink);
  min-height: 34px;
  padding: 0 10px;
  font-weight: 800;
}

.answer-button.correct {
  background: #d7e7e3;
  border-color: rgba(22, 113, 106, 0.45);
  color: var(--accent-strong);
}

.answer-button.wrong {
  background: #f6d8d3;
  border-color: rgba(185, 74, 72, 0.45);
  color: var(--red);
}

.answer-feedback {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  min-height: 18px;
}

.task-action,
.ghost-button,
.primary-button,
.icon-button,
.audio-button,
.small-audio-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 800;
}

.task-action,
.primary-button {
  background: var(--accent);
  color: white;
}

.task-action.done {
  background: #d7e7e3;
  color: var(--accent-strong);
}

.task-action:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  background: #d8d1c5;
  color: #7a746b;
  cursor: not-allowed;
  opacity: 1;
}

.completion-gate {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 11px 12px;
  margin: 0 0 12px;
  border: 1px solid rgba(185, 74, 72, 0.3);
  background: #fff0ec;
  color: #6d2d2b;
}

.completion-gate.ready {
  border-color: rgba(22, 113, 106, 0.32);
  background: #eef7f2;
  color: var(--accent-strong);
}

.completion-gate strong {
  font-size: 14px;
}

.completion-gate span {
  color: inherit;
  line-height: 1.45;
  font-size: 13px;
}

.ghost-button,
.icon-button,
.audio-button,
.small-audio-button {
  background: #ede7dc;
  color: #383735;
}

.audio-button {
  white-space: nowrap;
}

.small-audio-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.speaking-box {
  display: grid;
  gap: 12px;
}

.speaking-box h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.speech-control-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
}

.record-button {
  min-width: 96px;
}

.speech-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.speech-status.listening {
  color: var(--accent-strong);
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf0;
  color: var(--ink);
  line-height: 1.5;
}

textarea:focus {
  outline: 3px solid rgba(22, 113, 106, 0.18);
  border-color: var(--accent);
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.score-result {
  border-left: 4px solid var(--accent);
  background: #f2f7f5;
  padding: 12px;
  border-radius: 6px;
  color: #2a3432;
  line-height: 1.5;
  min-height: 48px;
}

.score-result span,
.score-result em {
  display: block;
}

.score-result em {
  color: var(--muted);
  font-style: normal;
}

.score-result:empty {
  display: none;
}

.dashboard-section,
.growth-grid {
  margin-top: 16px;
}

.visual-learning-section {
  margin-top: 16px;
}

.visual-learning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.visual-subtitle {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--muted);
}

.picture-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.picture-card,
.sentence-card {
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--ink);
  border-radius: 8px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.picture-card:hover,
.sentence-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 113, 106, 0.45);
  box-shadow: 0 12px 24px rgba(43, 34, 19, 0.08);
}

.picture-card {
  padding: 10px;
  min-width: 0;
}

.picture-card img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  border-radius: 7px;
  display: block;
  margin-bottom: 9px;
}

.picture-card .word {
  display: block;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.picture-card .meaning {
  display: block;
  color: var(--accent-strong);
  font-weight: 800;
  margin: 3px 0;
}

.picture-card small,
.sentence-card small {
  color: var(--muted);
  line-height: 1.4;
  display: block;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sentence-card-list {
  display: grid;
  gap: 10px;
}

.sentence-card {
  width: 100%;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.sentence-card img {
  width: 112px;
  height: 86px;
  object-fit: cover;
  border-radius: 7px;
}

.sentence-card strong {
  display: block;
  margin-bottom: 5px;
}

.growth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.growth-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.roadmap-list {
  display: grid;
  gap: 10px;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.roadmap-item:first-child {
  border-top: 0;
}

.roadmap-item span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8e1d5;
  color: var(--muted);
  font-weight: 900;
}

.roadmap-item.done span,
.roadmap-item.active span {
  background: var(--accent);
  color: white;
}

.roadmap-item.active strong {
  color: var(--accent-strong);
}

.roadmap-item strong {
  display: block;
  margin-bottom: 4px;
}

.roadmap-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.history-summary div {
  background: #f2eee6;
  border-radius: 8px;
  padding: 12px;
}

.history-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.history-summary strong {
  font-size: 24px;
}

.history-bars {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: end;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding-top: 8px;
}

.history-day {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 5px;
}

.history-bar {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
}

.history-day small {
  color: var(--muted);
  font-size: 10px;
  writing-mode: vertical-rl;
  justify-self: center;
}

.install-section {
  margin-top: 16px;
  background: #202124;
  color: white;
  border-radius: 8px;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.install-section h3 {
  margin: 0;
  font-size: 20px;
}

.install-section p {
  margin: 5px 0 0;
  color: #d6d1c8;
  line-height: 1.5;
}

.dashboard-table {
  display: grid;
  gap: 10px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 1.5fr;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.dashboard-row:first-child {
  border-top: 0;
}

.dashboard-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.progress-bar {
  height: 8px;
  background: #e5ded2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 220ms ease;
}

.weakness {
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .profile-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-button {
    grid-template-columns: 38px 1fr;
  }

  .profile-level {
    display: none;
  }

  .parent-summary {
    margin-top: 0;
  }

  .content-grid,
  .task-work-grid,
  .assessment-layout,
  .upgrade-panel,
  .hero-panel,
  .growth-grid,
  .visual-learning-grid {
    grid-template-columns: 1fr;
  }

  .home-member-grid,
  .home-summary-grid,
  .home-hero,
  .assessment-mode-grid,
  .home-sync-controls {
    grid-template-columns: 1fr;
  }

  .home-hero-actions {
    justify-content: stretch;
  }

  .home-hero-actions button {
    flex: 1 1 150px;
  }

  .assessment-report {
    position: static;
  }

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

@media (max-width: 680px) {
  .workspace {
    padding: 18px 14px 28px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .profile-list {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions,
  .upgrade-actions {
    justify-content: stretch;
  }

  .topbar-actions > *,
  .upgrade-actions button {
    flex: 1 1 150px;
  }

  .section-head {
    display: grid;
  }

  .head-actions {
    justify-content: stretch;
  }

  .head-actions button,
  .button-row button {
    flex: 1 1 140px;
  }

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

  .speech-status {
    grid-column: 1 / -1;
  }

  .hero-copy,
  .task-column,
  .coach-panel,
  .dashboard-section,
  .visual-learning-section {
    padding: 18px;
  }

  .task-item {
    grid-template-columns: 40px 1fr auto;
  }

  .task-action {
    grid-column: 1 / -1;
  }

  .task-lock {
    grid-column: 1 / -1;
  }

  .task-score {
    justify-self: end;
  }

  .task-screen-head {
    grid-template-columns: auto 1fr;
    padding: 16px;
  }

  .task-mode .task-screen-head {
    padding: 12px 14px;
  }

  .task-mode .task-screen-head h3 {
    font-size: 22px;
  }

  .task-mode .task-screen-head p:last-child {
    display: none;
  }

  .practice-line {
    grid-template-columns: 1fr;
  }

  .task-vocab-grid {
    grid-template-columns: 1fr;
  }

  .task-vocab-card {
    grid-template-columns: 96px 1fr;
  }

  .task-vocab-card img {
    width: 96px;
  }

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

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

  .sentence-card {
    grid-template-columns: 88px 1fr;
  }

  .sentence-card img {
    width: 88px;
    height: 72px;
  }

  .install-section {
    display: grid;
  }

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