:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f9fafb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --text: #172033;
  --muted: #66758a;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --purple: #8b5cf6;
  --purple-dark: #7c3aed;
  --purple-soft: #f3e8ff;
  --secondary: #10b981;
  --secondary-soft: #ecfdf5;
  --accent: #f59e0b;
  --accent-soft: #fffbeb;
  --good: #10b981;
  --bad: #ef4444;
  --warn: #b7791f;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(139, 92, 246, 0.12), transparent 28%),
    linear-gradient(180deg, #eef2ff 0, rgba(249, 250, 251, 0) 280px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.shell {
  min-height: 100vh;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--text);
  background: transparent;
  padding: 0;
}

.brand-home:hover {
  color: var(--brand);
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #fff;
  box-shadow: 0 8px 16px rgba(31, 111, 235, 0.22);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 520px;
  margin: 0 auto;
  padding: 3px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
}

.nav-tab {
  position: relative;
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #312e81;
  background: #fff;
}

.nav-tab.active {
  color: #312e81;
  background: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
}

.account-chip {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.account-trigger {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 7px 4px 4px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

.account-trigger:hover,
.account-menu.open .account-trigger {
  border-color: rgba(199, 210, 254, 0.95);
  background: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.1);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff, #f3e8ff);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 500;
}

.account-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.12;
}

.account-meta strong {
  max-width: 104px;
  overflow: hidden;
  color: #1e293b;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta small {
  color: #94a3b8;
  font-size: 10px;
}

.account-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.account-menu.open .account-chevron {
  transform: translateY(2px) rotate(225deg);
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  width: 176px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  font-size: 13px;
}

.account-menu.open .account-popover {
  display: block;
}

.account-popover-head {
  display: grid;
  gap: 2px;
  padding: 4px 5px 8px;
  border-bottom: 1px solid #eef2f7;
}

.account-popover-head strong {
  overflow: hidden;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover-head small {
  color: #94a3b8;
  font-size: 11px;
}

.account-menu-item {
  width: 100%;
  margin-top: 6px;
  padding: 7px 8px;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.account-menu-item:hover {
  background: #f8fafc;
  color: #334155;
}

.content-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 14px auto 26px;
}

.feedback-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  border-radius: 999px;
  background: #fff;
  color: #4338ca;
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.16);
}

.feedback-fab:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  transform: translateY(-2px);
}

.feedback-fab span {
  font-size: 18px;
}

.feedback-fab strong {
  font-size: 13px;
}

.page-panel {
  min-height: calc(100vh - 116px);
  overflow: hidden;
}

.home-page {
  padding-bottom: 28px;
}

.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 300px;
  margin-bottom: 36px;
  padding: 34px 36px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--text);
  background: #f8fafc url("assets/yiya-home-hero.png?v=20260803") right center / auto 100% no-repeat;
  box-shadow: var(--shadow);
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  width: 48%;
  max-width: 520px;
  margin: 0;
  text-align: left;
}

.home-hero h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
  color: #18213a;
}

.home-hero p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
}

.home-tip {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #334155;
  border: 1px solid rgba(199, 210, 254, 0.8);
  font-size: 13px;
}

.home-section {
  margin-bottom: 34px;
}

.home-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--brand);
  font-size: 18px;
  letter-spacing: 0;
}

.home-section h2::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--purple));
}

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

.home-card {
  min-height: 124px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 16px;
  text-align: left;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.home-card:hover {
  transform: translateY(-4px);
  border-color: var(--lesson-primary, #bfdbfe);
  box-shadow: 0 16px 34px -10px color-mix(in srgb, var(--lesson-primary, #4f46e5) 26%, transparent), 0 14px 22px -14px rgba(15, 23, 42, 0.18);
}

.home-card.locked {
  opacity: 0.72;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
}

.home-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 850;
}

.home-card .home-card-icon {
  background: color-mix(in srgb, var(--lesson-primary, #3b82f6) 12%, white);
  color: var(--lesson-primary, var(--brand));
}

.home-card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-card-body {
  min-width: 0;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.home-card strong {
  display: block;
  margin-bottom: 0;
  font-size: 15px;
  color: #1f2937;
}

.home-card small {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lesson-primary, #4f46e5) 10%, white);
  color: var(--lesson-primary, var(--brand));
  font-size: 11px;
  font-weight: 800;
}

.home-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

.home-card > i {
  align-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #7b8797;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  text-align: center;
}

.home-stat b {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 22px;
}

.home-stat:nth-child(2) b {
  color: var(--secondary);
}

.home-stat:nth-child(3) b {
  color: var(--accent);
}

.home-stat:nth-child(4) b {
  color: #7c3aed;
}

.home-stat span {
  color: var(--muted);
}

.study-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.lesson-sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.lesson-sidebar > .section-head {
  flex: 0 0 auto;
}

.lesson-sidebar > .catalog {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.app-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px;
  transition: grid-template-columns 0.2s ease;
}

.app-grid.sidebar-collapsed {
  grid-template-columns: 40px minmax(0, 1fr) 360px;
}

.app-grid.rightbar-collapsed {
  grid-template-columns: 320px minmax(0, 1fr) 40px;
}

.app-grid.sidebar-collapsed.rightbar-collapsed {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

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

.sidebar,
.rightbar,
.main-panel,
.mobile-drawer,
.form {
  background: rgba(255, 255, 255, 0.96);
}

.sidebar,
.rightbar {
  height: calc(100vh - 100px);
  overflow: auto;
  position: sticky;
  top: 84px;
}

.app-grid.sidebar-collapsed .sidebar,
.app-grid.rightbar-collapsed .rightbar {
  display: none;
}

.icon-collapse {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.icon-collapse:hover,
.rail:hover {
  color: var(--brand);
  border-color: #bcd4ff;
  background: var(--brand-soft);
}

.icon-collapse.right {
  right: auto;
  left: 12px;
}

.rail {
  display: none;
  position: sticky;
  top: 84px;
  align-self: start;
  height: calc(100vh - 100px);
  width: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0;
  padding: 10px 0;
  box-shadow: var(--shadow-soft);
}

.rail span,
.rail strong {
  display: block;
  writing-mode: vertical-rl;
}

.rail span {
  margin: 0 auto 10px;
  font-size: 20px;
}

.rail strong {
  margin: 0 auto;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.app-grid.sidebar-collapsed .rail-left,
.app-grid.rightbar-collapsed .rail-right {
  display: block;
}

.section-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.rightbar .section-head {
  padding-right: 18px;
  padding-left: 50px;
}

.section-head h2,
.section-head h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0;
}

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

.catalog-mobile-current,
.catalog-toggle {
  display: none;
}

.catalog {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.catalog-page .catalog {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.catalog-page .group-title {
  grid-column: 1 / -1;
  margin: 8px 2px 0;
  padding-top: 6px;
}

.catalog-page .lesson-row {
  min-height: 108px;
  align-content: space-between;
  padding: 16px;
  background: #fff;
  border-color: #e5edf7;
  box-shadow: var(--shadow-soft);
}

.catalog-page .lesson-row:hover,
.catalog-page .lesson-row.active {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.group-title {
  margin: 16px 8px 7px;
  color: #74849a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lesson-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lesson-row:hover,
.lesson-row.active {
  background: color-mix(in srgb, var(--lesson-primary, #3b82f6) 10%, white);
  border-color: color-mix(in srgb, var(--lesson-primary, #3b82f6) 28%, white);
}

.lesson-row:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--lesson-primary, #4f46e5) 42%, white);
  box-shadow: inset 4px 0 0 var(--lesson-primary, var(--brand)), 0 0 0 3px color-mix(in srgb, var(--lesson-primary, #4f46e5) 14%, transparent);
}

.lesson-row.active {
  box-shadow: inset 4px 0 0 var(--lesson-primary, var(--brand));
}

.lesson-row.locked {
  opacity: 0.68;
}

.lesson-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}

.lesson-row-main {
  min-width: 0;
}

.lesson-row-main > span {
  display: -webkit-box;
  overflow: hidden;
  color: #8a98aa;
  font-size: 10px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-row-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.badge {
  align-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.lesson-row .level-tag {
  font-size: 10px;
  line-height: 1.2;
}

.lesson-row-progress {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.lesson-row-progress.read {
  background: #eef2ff;
  color: #4f46e5;
}

.lesson-row-progress.partial {
  background: #fff7ed;
  color: #b45309;
}

.lesson-row-progress.done {
  background: #ecfdf5;
  color: #059669;
}

.badge.open {
  background: #dcfce7;
  color: #167247;
}

.level-tag.level-entry {
  background: #dbeafe;
  color: #2563eb;
}

.level-tag.level-basic {
  background: #dcfce7;
  color: #047857;
}

.level-tag.level-advanced {
  background: #fce7f3;
  color: #be185d;
}

.lesson-row.locked .level-tag {
  background: #eef2f7;
  color: #94a3b8;
}

.main-panel {
  min-height: calc(100vh - 116px);
  overflow: hidden;
}

.lesson-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 18px 22px;
  border-bottom: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--lesson-primary, #60a5fa) 86%, white), color-mix(in srgb, var(--lesson-secondary, #8b5cf6) 86%, white)),
    var(--lesson-primary, var(--brand));
  color: #fff;
}

.lesson-toolbar-main {
  min-width: 0;
}

.lesson-toolbar h1 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lesson-toolbar p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lesson-toolbar-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 400;
}

.lesson-toolbar-actions {
  flex: 0 0 auto;
}

.btn.lesson-toolbar-practice {
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--lesson-primary, var(--brand));
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.btn.lesson-toolbar-practice:hover {
  background: #fff;
  transform: translateY(-1px);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.tab,
.btn {
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.btn:hover,
.tab:hover {
  transform: translateY(-1px);
}

.tab.active,
.btn.primary {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.22);
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: #475569;
}

.btn:disabled {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.78;
  cursor: default;
}

.btn.ghost:hover {
  border-color: #bcd4ff;
  color: var(--brand);
  background: var(--brand-soft);
}

.btn.danger {
  background: #fee2e2;
  color: var(--bad);
}

.btn.danger:hover {
  background: #fecaca;
}

.btn.mistake-action {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  box-shadow: none;
}

.btn.mistake-action:hover {
  background: #ffedd5;
  border-color: #fdba74;
  color: #92400e;
}

.btn.mistake-action:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.22);
  outline-offset: 2px;
}

.lesson-content-shell {
  height: calc(100vh - 202px);
  overflow: auto;
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 72%, #f8fafc 100%);
  font-size: 14px;
}

.lesson-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 34px;
  font-size: 14px;
  line-height: 1.58;
  color: #263449;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover {
  padding: 16px;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .md\:col-span-2 {
  grid-column: auto;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover h4 {
  margin: 0 0 10px;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover > p {
  margin-bottom: 12px;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover ul {
  padding-left: 0;
  list-style: none;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f7;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover li:last-child {
  border-bottom: 0;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover li > span:first-child {
  color: #64748b;
  font-size: 12px;
}

.lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover li > span:last-child {
  min-width: 0;
  line-height: 1.65;
}

.lesson-content[data-lesson-file="2_there_be.html"] #basics .md\:grid-cols-2,
.lesson-content[data-lesson-file="2_there_be.html"] #details .md\:grid-cols-2,
.lesson-content[data-lesson-file="2_there_be.html"] #examples .md\:grid-cols-3 {
  grid-template-columns: minmax(0, 1fr);
}

.lesson-content[data-lesson-file="2_there_be.html"] #basics > .bg-white,
.lesson-content[data-lesson-file="2_there_be.html"] #details > .bg-white,
.lesson-content[data-lesson-file="2_there_be.html"] #examples .card-hover {
  padding: 16px;
}

.lesson-content[data-lesson-file="2_there_be.html"] h5 {
  margin: 0 0 7px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.lesson-content[data-lesson-file="2_there_be.html"] #basics .rule-box {
  margin: 10px 0;
  padding: 10px 12px;
}

.lesson-content[data-lesson-file="2_there_be.html"] #details .card-hover ul,
.lesson-content[data-lesson-file="2_there_be.html"] #examples ul {
  padding-left: 0;
  list-style: none;
}

.lesson-content[data-lesson-file="2_there_be.html"] #details .card-hover li,
.lesson-content[data-lesson-file="2_there_be.html"] #examples li {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}

.lesson-content[data-lesson-file="2_there_be.html"] #details .card-hover li:last-child,
.lesson-content[data-lesson-file="2_there_be.html"] #examples li:last-child {
  border-bottom: 0;
}

.lesson-content[data-lesson-file="2_there_be.html"] #examples .grid {
  gap: 12px;
}

.lesson-content > .text-center.mb-16:first-child,
.lesson-content > .bg-gradient-to-r.text-white:first-child {
  display: none;
}

.lesson-next-action {
  display: flex;
  width: calc(100% - 48px);
  max-width: 932px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 28px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.lesson-next-action span {
  color: #64748b;
  font-size: 13px;
}

.lesson-next-action .btn {
  min-width: 118px;
  padding: 7px 12px;
  font-weight: 400;
}

.lesson-content .text-center {
  text-align: center;
}

.lesson-content h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
  color: #111827;
}

.lesson-content h3 {
  margin: 24px 0 12px;
  font-size: 16px;
  color: var(--brand);
}

.lesson-content h4 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.lesson-content p {
  margin: 0 0 10px;
}

.lesson-content section {
  margin-bottom: 28px;
}

.lesson-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.lesson-content th,
.lesson-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.lesson-content th {
  background: #f3f7fc;
  color: #475569;
  font-size: 13px;
}

.lesson-content ul,
.lesson-content ol {
  padding-left: 20px;
}

.lesson-content li {
  margin: 6px 0;
}

.lesson-content em {
  color: #334155;
}

.lesson-content .bg-white,
.lesson-content .rounded-xl,
.lesson-content .shadow-lg,
.lesson-content .shadow-md {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.lesson-content .bg-white:not([class*="p-"]):not([class*=" p-"]) {
  padding: 14px;
}

.lesson-content .rounded,
.lesson-content .rounded-lg,
.lesson-content .rounded-xl,
.lesson-content .rounded-2xl {
  border-radius: 8px;
}

.lesson-content .rounded-full {
  border-radius: 999px;
}

.lesson-content .overflow-x-auto {
  overflow-x: auto;
}

.lesson-content .text-primary {
  color: var(--lesson-primary, var(--brand));
  font-weight: 700;
}

.lesson-content .font-medium {
  font-weight: 700;
}

.lesson-content .text-secondary {
  color: var(--lesson-secondary, var(--secondary));
}

.lesson-content .text-accent {
  color: var(--lesson-accent, var(--accent));
}

.lesson-content .text-gray-600 {
  color: var(--muted);
}

.lesson-content .text-gray-500 {
  color: #64748b;
}

.lesson-content .text-red-500 {
  color: #dc2626;
}

.lesson-content .text-green-600 {
  color: #059669;
}

.lesson-content .example-highlight {
  background: #e8f1ff;
  padding: 1px 4px;
  border-radius: 4px;
}

.lesson-content .highlight {
  border-radius: 4px;
  padding: 1px 4px;
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 12%, white);
  color: color-mix(in srgb, var(--lesson-primary, var(--brand)) 78%, #0f172a);
  font-weight: 700;
}

.lesson-content .question-mark {
  position: relative;
  padding-left: 23px;
}

.lesson-content .question-mark::before {
  content: "?";
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 12%, white);
  color: var(--lesson-primary, var(--brand));
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.lesson-content .rule-box {
  border-left: 4px solid var(--lesson-primary, var(--brand));
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 6%, white);
  border-radius: 8px;
}

.lesson-content .card-hover.overflow-hidden {
  padding: 0;
}

.lesson-content .card-hover.overflow-hidden > .bg-primary {
  margin: -1px -1px 0;
  padding: 10px 12px;
  border-radius: 8px 8px 0 0;
}

.lesson-content .card-hover.overflow-hidden > .p-6,
.lesson-content .card-hover.overflow-hidden > .p-5 {
  padding: 13px;
}

.lesson-content .bg-light.p-2,
.lesson-content .bg-gray-50.p-2 {
  padding: 6px 8px;
  border: 1px solid #edf2f7;
}

.lesson-content .bg-light.p-5,
.lesson-content .bg-gray-50.p-5 {
  padding: 13px;
}

.lesson-content .font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.lesson-content .divide-y > * + * {
  border-top: 1px solid var(--line);
}

.lesson-content .border-b {
  border-bottom: 1px solid var(--line);
}

.lesson-content .min-w-full {
  min-width: 100%;
}

.lesson-content .grid {
  display: grid;
  gap: 14px;
}

.lesson-content .grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-content .gap-2 {
  gap: 8px;
}

.lesson-content .flex {
  display: flex;
}

.lesson-content .flex-col {
  flex-direction: column;
}

.lesson-content .items-center {
  align-items: center;
}

.lesson-content .items-start {
  align-items: flex-start;
}

.lesson-content .justify-between {
  justify-content: space-between;
}

.lesson-content .space-y-2 > * + * {
  margin-top: 6px;
}

.lesson-content .space-y-1 > * + * {
  margin-top: 4px;
}

.lesson-content .space-y-3 > * + * {
  margin-top: 9px;
}

.lesson-content .space-y-4 > * + * {
  margin-top: 12px;
}

.lesson-content .gap-4 {
  gap: 12px;
}

.lesson-content .gap-6 {
  gap: 16px;
}

.lesson-content .mb-3 {
  margin-bottom: 9px;
}

.lesson-content .mb-4 {
  margin-bottom: 12px;
}

.lesson-content .mb-6 {
  margin-bottom: 16px;
}

.lesson-content .mb-8 {
  margin-bottom: 20px;
}

.lesson-content .mb-10 {
  margin-bottom: 24px;
}

.lesson-content .mr-2 {
  margin-right: 8px;
}

.lesson-content .mr-3 {
  margin-right: 12px;
}

.lesson-content .p-4 {
  padding: 12px;
}

.lesson-content .p-5 {
  padding: 14px;
}

.lesson-content .p-6 {
  padding: 15px;
}

.lesson-content .p-8,
.lesson-content .md\:p-8 {
  padding: 16px;
}

.lesson-content .p-12,
.lesson-content .md\:p-12 {
  padding: 20px;
}

.lesson-content .px-4 {
  padding-left: 12px;
  padding-right: 12px;
}

.lesson-content .py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}

.lesson-content .py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.lesson-content .py-3 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.lesson-content .pl-4 {
  padding-left: 14px;
}

.lesson-content .pl-5 {
  padding-left: 20px;
}

.lesson-content .pb-4 {
  padding-bottom: 12px;
}

.lesson-content .text-lg {
  font-size: 13px;
}

.lesson-content .text-xl {
  font-size: 15px;
}

.lesson-content .text-2xl {
  font-size: 16px;
}

.lesson-content .w-12,
.lesson-content .h-12 {
  width: 38px;
  height: 38px;
}

.lesson-content .mt-1 {
  margin-top: 4px;
}

.lesson-content .mt-3 {
  margin-top: 12px;
}

.lesson-content .mt-8 {
  margin-top: 18px;
}

.lesson-content .max-w-3xl {
  max-width: 720px;
}

.lesson-content .mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.lesson-content .font-semibold,
.lesson-content .font-bold {
  font-weight: 750;
}

.lesson-content .italic {
  font-style: italic;
}

.lesson-content .text-dark,
.lesson-content .text-gray-800 {
  color: var(--text);
}

.lesson-content .text-gray-700 {
  color: #334155;
}

.lesson-content .text-sm {
  font-size: 14px;
}

.lesson-content .bg-gray-50,
.lesson-content .bg-light,
.lesson-content .bg-blue-50,
.lesson-content .bg-green-50,
.lesson-content .bg-yellow-50,
.lesson-content .bg-purple-50,
.lesson-content .bg-red-50 {
  background: #f8fafc;
}

.lesson-content .bg-primary\/5,
.lesson-content .bg-primary\/10 {
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 8%, white);
}

.lesson-content .bg-white\/20 {
  background: rgba(255, 255, 255, 0.2);
}

.lesson-content .bg-primary,
.lesson-content .bg-blue-500 {
  background: var(--lesson-primary, var(--brand));
  color: #fff;
}

.lesson-content .bg-secondary,
.lesson-content .bg-green-500 {
  background: var(--lesson-secondary, var(--secondary));
  color: #fff;
}

.lesson-content .bg-accent,
.lesson-content .bg-yellow-500 {
  background: var(--lesson-accent, var(--accent));
  color: #fff;
}

.lesson-content .bg-red-500 {
  background: #ef4444;
  color: #fff;
}

.lesson-content .text-white {
  color: #fff;
}

.lesson-content .border,
.lesson-content .border-t,
.lesson-content .border-l-4 {
  border-color: var(--line);
}

.lesson-content .rounded-lg {
  border-radius: 8px;
}

.lesson-content .overflow-hidden {
  overflow: hidden;
}

.lesson-content :is(.card-hover, .bg-white, .bg-light, .bg-gray-50) {
  container-type: inline-size;
}

.lesson-content .card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lesson-content .card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.1);
}

@container (max-width: 420px) {
  .lesson-content .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 768px) {
  .lesson-content .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-content .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lesson-content .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1200px) {
  .lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }

  .lesson-content[data-lesson-file="2_there_be.html"] #basics .md\:grid-cols-2,
  .lesson-content[data-lesson-file="2_there_be.html"] #details .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-content[data-lesson-file="2_there_be.html"] #examples .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lesson-content .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lesson-content .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.exercise-wrap {
  padding: 24px;
  background: #fbfdff;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.question-card:hover {
  border-color: #cfe0ff;
}

.question-card.question-focus {
  animation: focusPulse 0.8s ease;
}

.question-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.question-prompt {
  min-width: 0;
}

.question-stats {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 92px;
  padding: 5px 8px;
  border: 1px solid #e5edf7;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.question-stats span {
  display: inline-flex;
  gap: 2px;
  align-items: baseline;
}

.question-stats b {
  color: #1f2937;
  font-size: 12px;
}

.question-stats span:first-child b {
  color: #059669;
}

.question-stats span:last-child b {
  color: #dc2626;
}

.question-stats.muted-state {
  justify-content: center;
  min-width: 54px;
  color: #94a3b8;
}

.question-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.legacy-question-title {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.legacy-question-title > span {
  font-weight: 800;
  color: var(--brand);
}

.legacy-question-title h3,
.legacy-question-title h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.legacy-question-title p {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.legacy-question-title .question-underline {
  color: #334155;
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.self-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.smart-answer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fbfdff;
}

.smart-answer label {
  font-weight: 750;
  color: #334155;
}

.smart-answer textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

.smart-answer textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--brand);
}

.structured-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.structured-answer-head strong {
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.structured-answer-head span {
  color: #94a3b8;
  font-size: 12px;
}

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

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

.structured-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.structured-field > span {
  color: #475569;
  font-size: 12px;
  font-weight: 400;
}

.structured-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.structured-field input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.16);
  border-color: #a5b4fc;
}

.structured-field.correct input {
  border-color: #86efac;
  background: #f0fdf4;
}

.structured-field.wrong input {
  border-color: #fecaca;
  background: #fff7f7;
}

.structured-field small {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
}

.structured-field.correct small {
  color: #059669;
}

.structured-field.wrong small {
  color: #dc2626;
}

.slot-result-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.slot-result-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.slot-result-list span.correct {
  background: #ecfdf5;
  color: #059669;
}

.slot-result-list span.wrong {
  background: #fff7ed;
  color: #b45309;
}

.confirm-actions {
  margin-top: 10px;
}

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

.option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  text-align: left;
}

.option-label {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.option-text {
  min-width: 0;
  line-height: 1.5;
}

.option:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.result {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 8px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.result strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.result.good {
  background: #dcfce7;
  color: #16603f;
  border-color: #bbf7d0;
}

.result.good .result-icon {
  background: #10b981;
  animation: checkPop 0.42s ease;
}

.result.bad {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.result.bad .result-icon {
  background: #ef4444;
}

.result.is-wrong {
  animation: answerShake 0.34s ease;
}

.result.warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.result.warn .result-icon {
  background: #f59e0b;
}

.writing-hint {
  display: inline-flex;
  margin-top: 10px;
  color: #9a5b08;
  font-size: 13px;
}

.reference-answer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #245b43;
}

.reference-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #d1fae5;
}

.reference-answer-head span {
  color: #166534;
  font-size: 15px;
  font-weight: 600;
}

.reference-answer-head small {
  color: #5f7d6d;
  font-size: 12px;
}

.reference-answer p,
.reference-answer ol {
  margin: 0;
}

.reference-answer p {
  line-height: 1.65;
}

.reference-answer ol {
  display: grid;
  gap: 8px;
  padding-left: 24px;
}

.reference-answer li {
  padding-left: 4px;
  line-height: 1.6;
}

.reference-answer li::marker {
  color: #10b981;
  font-weight: 600;
}

.reference-explanation {
  padding-top: 10px;
  border-top: 1px solid #d1fae5;
  color: #466657;
  font-size: 13px;
  line-height: 1.65;
}

.mistake-inline {
  margin-top: 12px;
  font-weight: 400;
}

.mistake-status {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 4px 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.mistake-status::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 999px;
  background: #f59e0b;
  opacity: 0.72;
}

@keyframes checkPop {
  0% {
    transform: scale(0.55);
    opacity: 0.25;
  }
  70% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes answerShake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  55% {
    transform: translateX(4px);
  }
  78% {
    transform: translateX(-2px);
  }
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.28);
  }
  100% {
    box-shadow: var(--shadow-soft);
  }
}

.progress-dashboard {
  background: #fff;
}

.progress-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.94), rgba(139, 92, 246, 0.9)),
    var(--brand);
}

.progress-hero h2 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: 0;
}

.progress-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.progress-hero strong {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border: 6px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.progress-overview {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.progress-meter {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.progress-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: #334155;
  font-weight: 800;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--purple));
}

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

.progress-page .stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
}

.stat {
  padding: 15px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #e5edf7;
}

.progress-page .stat {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: #dbeafe;
  box-shadow: var(--shadow-soft);
}

.progress-page .stat.completed {
  border-color: #bbf7d0;
  background: var(--secondary-soft);
}

.progress-page .stat.learning {
  border-color: #bfdbfe;
  background: var(--brand-soft);
}

.progress-page .stat.pending {
  border-color: #fde68a;
  background: var(--accent-soft);
}

.progress-detail .section-head {
  background: #fff;
}

.mistake-analysis {
  padding: 22px 24px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfcff);
}

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

.analysis-kicker {
  color: #6366f1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.analysis-section-head h3 {
  margin: 4px 0 5px;
  color: #172033;
  font-size: 18px;
}

.analysis-section-head p,
.analysis-empty p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-total {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.mistake-chart {
  display: grid;
  gap: 7px;
}

.mistake-chart-row {
  display: grid;
  grid-template-columns: 26px minmax(86px, 150px) minmax(120px, 1fr) 50px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 8px;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  text-align: left;
}

.mistake-chart-row:hover {
  background: #f1f5ff;
}

.mistake-chart-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef2ff;
  color: #6366f1;
  font-size: 11px;
  font-weight: 800;
}

.mistake-chart-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-chart-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.mistake-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #818cf8, #f59e0b);
}

.mistake-chart-row > b {
  color: #475569;
  font-size: 12px;
  text-align: right;
}

.analysis-empty {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px dashed #bfdbfe;
  border-radius: 10px;
  background: #f8fbff;
}

.analysis-empty > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dcfce7;
  color: #059669;
  font-weight: 800;
}

.progress-groups {
  padding: 16px 18px 22px;
}

.progress-group + .progress-group {
  margin-top: 24px;
}

.progress-group h4 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 16px;
}

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

.progress-lesson {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.progress-lesson.completed {
  border-left: 5px solid var(--secondary);
}

.progress-lesson.learning {
  border-left: 5px solid var(--brand);
}

.progress-lesson.not_started {
  border-left: 5px solid var(--accent);
}

.progress-lesson.locked {
  opacity: 0.55;
}

.progress-status {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-lesson.completed .progress-status {
  background: #dcfce7;
  color: #047857;
}

.progress-lesson.learning .progress-status {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.progress-lesson.not_started .progress-status {
  background: var(--accent-soft);
  color: #b45309;
}

.progress-lesson h5 {
  margin: 0 0 6px;
  font-size: 15px;
}

.progress-lesson p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.progress-lesson-metrics span {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.progress-lesson-metrics .practice-count.pending {
  background: #f8fafc;
}

.progress-lesson-metrics .practice-count.partial {
  background: #eff6ff;
  color: #2563eb;
}

.progress-lesson-metrics .practice-count.done {
  background: #ecfdf5;
  color: #047857;
}

.progress-lesson-metrics .practice-count.empty {
  background: #f1f5f9;
  color: #94a3b8;
}

.progress-lesson-metrics b {
  color: var(--text);
  font-size: 15px;
}

.progress-lesson-metrics .practice-count.partial b {
  color: #1d4ed8;
}

.progress-lesson-metrics .practice-count.done b {
  color: #047857;
}

.progress-lesson-metrics .practice-count.empty b {
  color: #64748b;
}

.progress-lesson-metrics .lesson-mistake-count.has-mistakes {
  background: #fff7ed;
  color: #b45309;
}

.progress-lesson-metrics .lesson-mistake-count.has-mistakes b {
  color: #c2410c;
}

.progress-lesson-actions {
  display: flex;
  gap: 8px;
}

.progress-lesson-actions .btn {
  font-weight: 400;
}

.progress-lesson-actions .mistake-view-btn {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.stat b {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
  color: #12233d;
}

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

.mistake-list {
  padding: 14px;
}

.mistakes-page .mistake-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.mistake-filters {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.mistake-filters label {
  display: grid;
  gap: 5px;
}

.mistake-filters label > span {
  color: #64748b;
  font-size: 11px;
}

.mistake-filters select {
  min-width: 190px;
  height: 36px;
  padding: 0 34px 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
}

.mistake-status-filters {
  display: flex;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}

.mistake-status-filters button {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
}

.mistake-status-filters button.active {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
}

.mistake-filter-count {
  margin-left: auto;
  padding-bottom: 8px;
  color: #64748b;
  font-size: 12px;
}

.mistake-filter-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.mistake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  font-size: 13px;
}

.mistakes-page .mistake {
  margin-bottom: 0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.mistake.mastered {
  background: #fbfdff;
  opacity: 0.78;
}

.mistake p {
  margin: 0;
  line-height: 1.5;
}

.mistake-main {
  min-width: 0;
}

.mistake-topline {
  display: flex;
  align-items: center;
  margin-bottom: 7px;
}

.mistake-lesson {
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mistake-state {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
}

.mistake-state.pending {
  background: #fff7ed;
  color: #b45309;
}

.mistake-state.mastered {
  background: #ecfdf5;
  color: #059669;
}

.mistake-stem {
  color: #172033;
  font-size: 13px;
  font-weight: 400;
}

.mistake-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.mistake-meta span {
  min-width: 0;
  padding: 4px 7px;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.mistake-actions {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.btn.mistake-retry {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(199, 210, 254, 0.95);
  border-radius: 8px;
  background: #fff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
}

.btn.mistake-retry:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

.btn.mistake-retry.is-mastered {
  border-color: #dbe4f0;
  color: #64748b;
}

.btn.mistake-retry.is-mastered:hover {
  background: #f8fafc;
  color: #475569;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.mobile-only {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.42);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 21;
  width: min(88vw, 380px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.1), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.login-shell {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(400px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(199, 210, 254, 0.72);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(49, 46, 129, 0.16);
}

.login-copy {
  position: relative;
  min-height: 100%;
  padding: 0;
  overflow: hidden;
  background: #eef2ff;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-copy::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 8px;
  pointer-events: none;
}

.login-copy-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.login-copy .brand {
  position: absolute;
  left: 30px;
  top: 30px;
  z-index: 2;
  color: #18213a;
  text-shadow: none;
}

.login-copy .brand span:last-child {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.login-copy .brand-mark {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.login-copy .brand-logo {
  width: 42px;
  height: 42px;
}

.login-pc-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  object-position: center;
}

.login-copy h1 {
  max-width: 420px;
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 430px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.75;
}

.login-preview {
  width: min(360px, 100%);
  margin-top: 54px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.login-preview div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
}

.login-preview div + div {
  margin-top: 14px;
}

.login-preview span {
  width: 42px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
}

.login-preview b {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.login-preview div:nth-child(2) b {
  width: 74%;
}

.login-preview div:nth-child(3) b {
  width: 58%;
}

.login-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: #fff;
}

.form {
  width: min(390px, 100%);
  padding: 0;
  border: 0;
  box-shadow: none;
}

.login-form-head {
  padding: 0;
  margin-bottom: 28px;
  border-bottom: 0;
}

.login-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form-head h2 {
  margin-bottom: 8px;
  font-size: 26px;
}

.login-form-head p {
  font-size: 13px;
}

.login-mobile-hero {
  display: none;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #334155;
  font-size: 13px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f9fafb;
  color: var(--text);
}

.field input:focus {
  outline: 3px solid rgba(79, 70, 229, 0.14);
  border-color: var(--brand);
  background: #fff;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.form-actions .btn {
  min-height: 34px;
  flex: 1 1 0;
}

.account-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  color: #64748b;
  font-size: 13px;
}

.account-entry button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.account-entry button:hover {
  color: #3730a3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.modal-open {
  overflow: hidden;
}

.account-modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
}

.account-modal {
  position: relative;
  width: min(650px, 100%);
  padding: 34px;
  border: 1px solid rgba(199, 210, 254, 0.8);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(30, 41, 59, 0.28);
}

.account-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.account-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.account-modal-heading {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  padding-right: 36px;
  margin-bottom: 26px;
}

.account-modal-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
}

.account-modal-heading h2 {
  margin: 2px 0 7px;
  color: #172033;
  font-size: 24px;
  line-height: 1.25;
}

.account-modal-heading p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.wechat-contact {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.wechat-contact div {
  display: grid;
  gap: 4px;
  flex: 1;
}

.wechat-qr {
  display: block;
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

.wechat-contact strong {
  color: #166534;
}

.wechat-contact span {
  color: #475569;
  font-size: 13px;
}

.account-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #94a3b8;
  font-size: 12px;
}

.account-divider::before,
.account-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.account-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.account-application-form {
  display: grid;
  gap: 18px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.account-application-form .field {
  margin: 0;
}

.account-application-form .field em {
  color: #ef4444;
  font-style: normal;
}

.account-application-form .field label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.account-application-form .field label small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 400;
}

.account-contact-note {
  grid-column: 1 / -1;
  margin: -2px 0 -4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.account-application-form .field input,
.account-application-form .field select,
.account-application-form .field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.account-application-form .field input::placeholder,
.account-application-form .field textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 1;
}

.account-application-form .field input,
.account-application-form .field select {
  height: 44px;
  padding: 0 13px;
}

.account-application-form .field textarea {
  min-height: 88px;
  padding: 11px 13px;
  resize: vertical;
}

.account-application-form .field input:focus,
.account-application-form .field select:focus,
.account-application-form .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.account-form-message {
  min-height: 0;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.account-form-message.bad {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
}

.account-submit {
  width: 100%;
  min-height: 46px;
}

.account-privacy {
  margin: -8px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.account-success {
  padding: 14px 0 4px;
  text-align: center;
}

.account-success > span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 28px;
  font-weight: 800;
}

.account-success h3 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 22px;
}

.account-success p {
  margin: 0 0 22px;
  color: #64748b;
  line-height: 1.7;
}

.feedback-modal {
  width: min(680px, 100%);
}

.feedback-modal-icon {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.feedback-form {
  display: grid;
  gap: 20px;
}

.feedback-form .field {
  position: relative;
  margin: 0;
}

.feedback-form .field > span {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.feedback-form .field em {
  color: #ef4444;
  font-style: normal;
}

.feedback-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px 28px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #172033;
  font: inherit;
  line-height: 1.7;
  outline: none;
  resize: vertical;
}

.feedback-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.feedback-character-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #94a3b8;
  font-size: 11px;
}

.feedback-upload-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.feedback-upload-heading div {
  display: grid;
  gap: 3px;
}

.feedback-upload-heading strong {
  color: #334155;
  font-size: 14px;
}

.feedback-upload-heading span {
  color: #94a3b8;
  font-size: 12px;
}

.feedback-image-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.feedback-upload-tile,
.feedback-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.feedback-upload-tile {
  display: grid;
  place-content: center;
  gap: 3px;
  color: #64748b;
  text-align: center;
  cursor: pointer;
}

.feedback-upload-tile:hover {
  border-color: #818cf8;
  background: #eef2ff;
  color: #4338ca;
}

.feedback-upload-tile > span {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.feedback-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feedback-preview button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.feedback-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .mistake-analysis {
    padding: 18px 14px;
  }

  .analysis-section-head {
    align-items: flex-start;
  }

  .mistake-chart-row {
    grid-template-columns: 24px minmax(74px, 108px) minmax(70px, 1fr) 42px;
    gap: 7px;
    padding-inline: 2px;
  }

  .mistake-filters {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .mistake-filters select {
    width: 100%;
  }

  .mistake-status-filters button {
    flex: 1;
  }

  .mistake-filter-count {
    margin-left: 0;
    padding: 0;
  }

  .feedback-fab {
    right: 14px;
    bottom: 14px;
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .feedback-fab strong {
    display: none;
  }

  .feedback-image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .account-modal {
    max-height: 92vh;
    padding: 26px 20px 22px;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
  }

  .account-modal-heading {
    grid-template-columns: 40px 1fr;
    gap: 11px;
    margin-bottom: 22px;
  }

  .account-modal-icon {
    width: 40px;
    height: 40px;
  }

  .account-modal-heading h2 {
    font-size: 21px;
  }

  .account-form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .account-application-form {
    gap: 16px;
  }

  .account-application-form .field label {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .account-application-form .field input,
  .account-application-form .field select {
    height: 44px;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 16px;
  }

  .account-application-form .field textarea {
    min-height: 96px;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 16px;
  }

  .account-contact-note {
    margin: 0 0 -2px;
  }

  .wechat-contact {
    align-items: center;
    gap: 14px;
    padding: 14px;
  }

  .wechat-qr {
    width: 96px;
    height: 96px;
    flex-basis: 96px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .top-nav {
    order: 3;
    width: 100%;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .content-shell {
    width: min(100% - 24px, 1120px);
    margin-top: 12px;
  }

  .study-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 12px;
  }

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

  .progress-page .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .progress-lesson {
    grid-template-columns: 1fr;
  }

  .progress-lesson-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .rightbar {
    display: none;
  }

  .rail-right {
    display: block;
  }

  .app-grid.sidebar-collapsed,
  .app-grid.sidebar-collapsed.rightbar-collapsed {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .app-grid.rightbar-collapsed {
    grid-template-columns: 280px minmax(0, 1fr) 40px;
  }
}

@media (max-width: 1360px) and (min-width: 821px) {
  .topbar {
    padding: 0 16px;
  }

  .nav-tab {
    min-height: 30px;
    padding: 0 10px;
  }

  .app-grid {
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 12px;
    padding: 12px;
  }

  .app-grid.sidebar-collapsed {
    grid-template-columns: 40px minmax(0, 1fr) 320px;
  }

  .app-grid.rightbar-collapsed {
    grid-template-columns: 280px minmax(0, 1fr) 40px;
  }

  .app-grid.sidebar-collapsed.rightbar-collapsed {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .sidebar,
  .rightbar,
  .rail {
    height: calc(100vh - 92px);
    top: 80px;
  }

  .lesson-toolbar {
    min-height: 92px;
    padding: 16px 20px;
  }

  .lesson-toolbar h1 {
    font-size: 20px;
  }

  .lesson-content {
    padding: 18px 22px 34px;
  }

  .lesson-content-shell {
    height: calc(100vh - 218px);
  }

  .btn,
  .tab {
    padding: 6px 9px;
    font-size: 13px;
  }
}

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

  .login-screen {
    min-height: 100vh;
    padding: 16px;
    background:
      radial-gradient(circle at 8% 8%, rgba(125, 211, 252, 0.52), transparent 34%),
      radial-gradient(circle at 92% 8%, rgba(216, 180, 254, 0.58), transparent 34%),
      linear-gradient(135deg, #dff8ff 0%, #eef7ff 46%, #f3e8ff 100%);
  }

  .login-shell {
    width: min(320px, calc(100vw - 32px));
    min-height: auto;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 22px 44px rgba(79, 70, 229, 0.18);
  }

  .login-copy {
    display: none;
  }

  .login-card {
    display: block;
    padding: 24px 20px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
  }

  .login-mobile-hero {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 8px;
  }

  .login-mobile-logo {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #111827;
    font-weight: 850;
  }

  .login-mobile-logo .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    font-size: 22px;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
  }

  .login-mobile-logo .brand-logo {
    width: 52px;
    height: 52px;
  }

  .login-mobile-logo strong {
    font-size: 13px;
  }

  .login-mobile-art {
    display: block;
    width: 220px;
    height: 129px;
    margin: 8px 0 2px;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
  }

  .login-form-head {
    text-align: center;
    margin-bottom: 14px;
  }

  .login-kicker,
  .login-form-head p {
    display: none;
  }

  .login-form-head h2 {
    margin: 0;
    font-size: 19px;
  }

  .login-card .field {
    position: relative;
    margin-bottom: 9px;
  }

  .login-card .field label {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 1;
    width: 18px;
    height: 18px;
    margin: 0;
    overflow: hidden;
    color: transparent;
    transform: translateY(-50%);
  }

  .login-card .field label::before {
    content: "";
    position: absolute;
    inset: 2px;
    border: 2px solid #6b7280;
    border-radius: 999px;
  }

  .login-card .field label[for="password"]::before {
    inset: 4px 3px 2px;
    border-radius: 3px;
  }

  .login-card .field label[for="password"]::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 8px;
    height: 8px;
    border: 2px solid #6b7280;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
  }

  .login-card .field input {
    min-height: 30px;
    border-radius: 999px;
    padding: 6px 12px 6px 40px;
    background: rgba(255, 255, 255, 0.74);
    border-color: #9ca3af;
    font-size: 13px;
  }

  .form-actions {
    gap: 10px;
    margin-top: 18px;
  }

  .form-actions .btn.primary {
    min-height: 34px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #4f46e5 58%, #8b5cf6);
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.26);
  }

  .form-actions .btn.ghost {
    min-height: 30px;
    flex: 0 0 auto;
    align-self: center;
    padding: 5px 15px;
    border-radius: 999px;
    background: #fff;
    border-color: #60a5fa;
    color: #4f46e5;
    font-size: 13px;
  }

  .topbar {
    height: auto;
    min-height: 62px;
    padding: 8px 10px;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 15px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .top-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .account-chip {
    max-width: calc(100vw - 190px);
  }

  .account-trigger {
    max-width: 100%;
    min-height: 34px;
    gap: 6px;
    padding: 4px 6px 4px 4px;
  }

  .account-avatar {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }

  .account-meta small {
    display: none;
  }

  .account-meta strong {
    max-width: 76px;
    font-size: 12px;
  }

  .account-chevron {
    width: 6px;
    height: 6px;
  }

  .account-popover {
    width: 158px;
    right: 0;
  }

  .top-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px;
    border-radius: 999px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    min-height: 30px;
    padding: 0 9px;
    font-size: 13px;
  }

  .content-shell {
    width: calc(100% - 16px);
    margin: 8px auto 16px;
  }

  .home-hero {
    min-height: 250px;
    margin-bottom: 26px;
    padding: 24px 18px;
    background-position: 62% center;
    background-size: cover;
  }

  .home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
  }

  .home-hero-inner {
    width: 100%;
    max-width: 420px;
  }

  .home-hero h1 {
    font-size: 24px;
  }

  .home-hero p {
    font-size: 14px;
    line-height: 1.6;
  }

  .home-tip {
    border-radius: 8px;
    margin-top: 14px;
    padding: 7px 10px;
    line-height: 1.5;
  }

  .home-section {
    margin-bottom: 28px;
  }

  .home-section h2 {
    font-size: 17px;
    margin-bottom: 12px;
  }

  .home-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .home-card {
    min-height: 82px;
    padding: 12px;
    gap: 10px;
  }

  .home-card-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .home-card strong {
    font-size: 14px;
  }

  .home-card em {
    font-size: 12px;
    line-height: 1.45;
  }

  .study-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lesson-sidebar {
    position: static;
    max-height: 208px;
  }

  .lesson-sidebar.mobile-collapsed {
    max-height: none;
  }

  .lesson-sidebar.mobile-collapsed .catalog {
    display: none;
  }

  .catalog-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .catalog-head .catalog-description {
    display: none;
  }

  .catalog-mobile-current {
    display: block;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
  }

  .catalog-toggle:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
    color: #4f46e5;
  }

  .catalog-chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.18s ease;
  }

  .lesson-sidebar.mobile-open .catalog-chevron {
    transform: translateY(2px) rotate(225deg);
  }

  .page-panel,
  .main-panel {
    min-height: calc(100vh - 126px);
  }

  .progress-page .stats-grid,
  .mistakes-page .mistake-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 10px;
  }

  .progress-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px;
    gap: 16px;
  }

  .progress-hero h2 {
    font-size: 20px;
  }

  .progress-hero strong {
    width: 64px;
    height: 64px;
    border-width: 5px;
    font-size: 18px;
  }

  .progress-overview {
    padding: 12px;
  }

  .progress-meter {
    padding: 12px;
  }

  .progress-groups {
    padding: 12px;
  }

  .progress-lesson {
    padding: 12px;
    gap: 12px;
  }

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

  .progress-lesson-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lesson-sidebar .catalog {
    gap: 7px;
    padding: 6px 8px 8px;
  }

  .lesson-sidebar .section-head {
    padding: 12px 14px;
  }

  .lesson-sidebar .lesson-row {
    padding: 9px 10px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .login-copy {
    min-height: 250px;
    padding: 28px 22px;
  }

  .login-copy h1 {
    max-width: 340px;
    font-size: 26px;
  }

  .login-copy p {
    font-size: 14px;
    line-height: 1.65;
  }

  .login-copy .brand {
    margin-bottom: 34px;
  }

  .login-preview {
    display: none;
  }

  .login-card {
    padding: 28px 22px;
  }

  .sidebar {
    display: none;
  }

  .rightbar,
  .rail,
  .icon-collapse,
  .app-grid.sidebar-collapsed .rail-left,
  .app-grid.rightbar-collapsed .rail-right {
    display: none;
  }

  .app-grid,
  .app-grid.sidebar-collapsed,
  .app-grid.rightbar-collapsed,
  .app-grid.sidebar-collapsed.rightbar-collapsed {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .lesson-toolbar {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 15px 14px;
    gap: 12px;
  }

  .lesson-toolbar h1 {
    font-size: 19px;
  }

  .lesson-toolbar p {
    font-size: 12px;
  }

  .lesson-toolbar-meta {
    margin-top: 8px;
  }

  .lesson-toolbar-actions {
    display: grid;
  }

  .btn.lesson-toolbar-practice {
    width: 100%;
    min-height: 32px;
  }

  .lesson-content-shell {
    height: auto;
    min-height: calc(100vh - 210px);
  }

  .lesson-content {
    padding: 15px 12px 28px;
  }

  .lesson-content .p-5,
  .lesson-content .p-6,
  .lesson-content .md\:p-8 {
    padding: 12px;
  }

  .lesson-content .card-hover.overflow-hidden > .bg-primary,
  .lesson-content .card-hover.overflow-hidden > .p-6,
  .lesson-content .card-hover.overflow-hidden > .p-5 {
    padding: 11px;
  }

  .lesson-content .rule-box {
    padding-left: 12px;
  }

  .lesson-next-action {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    margin: 0 12px 24px;
    padding: 12px;
  }

  .lesson-next-action .btn {
    width: 100%;
    padding: 7px 12px;
    min-width: 0;
  }

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

  .exercise-wrap {
    padding: 14px;
  }

  .question-card {
    padding: 14px;
  }

  .question-card-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-stats {
    justify-self: end;
  }

  .smart-answer {
    padding: 12px;
  }

  .reference-answer {
    padding: 13px;
  }

  .reference-answer-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .self-check-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .structured-answer-head {
    display: grid;
    gap: 3px;
  }

  .structured-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .lesson-content[data-lesson-file="1-2_five_basic_sentence_patterns.html"] #examples > .grid > .card-hover li {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .login-card {
    padding: 24px 20px 20px;
  }

  .form {
    width: 100%;
  }

  .login-form-head {
    margin-bottom: 22px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn.ghost {
    width: auto;
  }

  .lesson-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .lesson-content h2 {
    font-size: 18px;
  }

  .lesson-content h3 {
    font-size: 15px;
  }

  .mobile-drawer {
    width: 92vw;
  }

  .btn,
  .tab {
    padding: 7px 9px;
    font-size: 13px;
  }

  .brand span:last-child {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-hero h1 {
    font-size: 23px;
  }

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

  .home-card > i {
    grid-column: 2;
  }

  .top-actions .btn {
    padding: 6px 8px;
  }

  .login-copy h1 {
    font-size: 24px;
  }

  .mistakes-page .mistake-list {
    grid-template-columns: 1fr;
  }

  .mistake {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .mistake-topline {
    align-items: flex-start;
  }

  .mistake-stem {
    font-size: 13px;
  }

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

  .btn.mistake-retry {
    width: auto;
    min-height: 30px;
    padding: 6px 10px;
  }

  .progress-lesson-metrics {
    gap: 6px;
  }

  .progress-lesson-metrics span {
    min-height: 40px;
    padding: 7px;
  }
}

/* Learning analysis: a lighter growth-focused surface that matches the YiYa mark. */
.progress-page {
  background: #f7f8fc;
}

.progress-dashboard {
  padding: 18px;
  background: #f7f8fc;
}

.progress-hero {
  min-height: 150px;
  padding: 24px 28px;
  border: 1px solid #dfe4ff;
  border-radius: 8px;
  color: #172033;
  background:
    linear-gradient(118deg, rgba(238, 242, 255, 0.98) 0 56%, rgba(236, 253, 245, 0.94) 100%);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
}

.progress-hero-copy {
  display: flex;
  align-items: center;
  gap: 18px;
}

.progress-hero-copy > img {
  width: 68px;
  height: 68px;
  padding: 9px;
  border: 1px solid rgba(165, 180, 252, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

.progress-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 600;
}

.progress-hero h2 {
  margin-bottom: 6px;
  color: #172033;
  font-size: 24px;
}

.progress-hero p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(#4f46e5 calc(var(--progress-value) * 1%), #dfe4f2 0);
}

.progress-ring::before {
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  background: #fff;
  content: "";
}

.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
}

.progress-ring strong {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3730a3;
  font-size: 21px;
  box-shadow: none;
}

.progress-ring span {
  margin-top: -24px;
  color: #94a3b8;
  font-size: 10px;
}

.progress-overview {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.6fr);
  gap: 14px;
  padding: 16px 0 20px;
  border-bottom: 0;
}

.progress-meter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 142px;
  margin: 0;
  padding: 20px;
  border-color: #dfe4ff;
  background: #fff;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.05);
}

.progress-meter-head {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.progress-meter-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.progress-meter-head i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px #d1fae5;
}

.progress-meter-head b {
  color: #4f46e5;
  font-size: 16px;
}

.progress-track {
  height: 8px;
  background: #edf0f7;
}

.progress-track span {
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #34d399);
}

.progress-meter > p {
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.55;
}

.progress-page .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.progress-page .stat {
  min-height: 66px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-color: #e6e9f2;
  background: #fff;
  box-shadow: 0 7px 18px rgba(30, 41, 59, 0.04);
}

.progress-page .stat.completed,
.progress-page .stat.learning,
.progress-page .stat.pending {
  border-color: #e6e9f2;
  background: #fff;
}

.progress-page .stat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
}

.progress-page .stat.completed .stat-icon {
  background: #dcfce7;
  color: #059669;
}

.progress-page .stat.learning .stat-icon,
.progress-page .stat.answered .stat-icon {
  background: #e0f2fe;
  color: #0284c7;
}

.progress-page .stat.pending .stat-icon {
  background: #fef3c7;
  color: #d97706;
}

.progress-page .stat.mistakes .stat-icon {
  background: #fff1f2;
  color: #e11d48;
}

.progress-page .stat b {
  margin: 0 0 2px;
  font-size: 17px;
}

.progress-page .stat div > span {
  font-size: 11px;
}

.mistake-analysis,
.progress-detail {
  overflow: hidden;
  border: 1px solid #e4e8f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.045);
}

.mistake-analysis {
  margin-bottom: 16px;
  padding: 20px;
}

.analysis-kicker {
  color: #4f46e5;
  font-weight: 600;
}

.analysis-empty {
  border-color: #c7d2fe;
  background: linear-gradient(90deg, #f8faff, #f4fdf8);
}

.analysis-empty > span {
  border-radius: 8px;
  background: #d1fae5;
}

.progress-detail .section-head {
  padding: 20px;
  border-bottom: 1px solid #edf0f5;
  background: linear-gradient(90deg, #fff, #fafbff);
}

.progress-detail .section-head h3 {
  margin: 4px 0 5px;
  font-size: 18px;
}

.progress-detail .section-head p {
  margin: 0;
  font-size: 12px;
}

.progress-groups {
  padding: 18px 20px 22px;
}

.progress-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 14px;
}

.progress-group h4::before {
  width: 5px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(#4f46e5, #34d399);
  content: "";
}

.progress-lesson {
  grid-template-columns: minmax(240px, 1.15fr) minmax(390px, 1fr) auto;
  gap: 14px;
  padding: 13px 14px;
  border-color: #e6e9f2;
  border-left-width: 1px;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.progress-lesson:not(.locked):hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.08);
  transform: translateY(-1px);
}

.progress-lesson.completed,
.progress-lesson.learning,
.progress-lesson.not_started {
  border-left-width: 4px;
}

.progress-lesson.locked {
  background: #fafbfc;
  opacity: 0.68;
}

.progress-lesson-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-lesson h5 {
  margin: 0;
  font-size: 14px;
}

.progress-status {
  order: 2;
  margin: 0;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 500;
}

.progress-lesson p {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.45;
}

.progress-lesson-bar {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.progress-lesson-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #34d399);
}

.progress-lesson-metrics {
  gap: 6px;
}

.progress-lesson-metrics span {
  min-height: 48px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f8fb;
  font-size: 11px;
}

.progress-lesson-metrics b {
  overflow: hidden;
  color: #253047;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-lesson-metrics small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 9px;
}

.progress-lesson-metrics .last-studied b {
  font-size: 10px;
}

.progress-lesson-actions {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 8px;
  justify-content: end;
  width: 280px;
}

.progress-lesson-actions .btn {
  width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .progress-overview {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .progress-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-lesson {
    grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1fr);
  }

  .progress-lesson-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 88px);
    justify-self: end;
  }
}

@media (max-width: 820px) {
  .progress-page {
    background: #f7f8fc;
  }

  .progress-dashboard {
    padding: 10px;
  }

  .progress-hero {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }

  .progress-hero-copy {
    min-width: 0;
    gap: 11px;
  }

  .progress-hero-copy > img {
    width: 44px;
    height: 44px;
    padding: 6px;
  }

  .progress-eyebrow {
    font-size: 10px;
  }

  .progress-hero h2 {
    margin-bottom: 2px;
    font-size: 18px;
  }

  .progress-hero p {
    max-width: 220px;
    font-size: 11px;
    line-height: 1.45;
  }

  .progress-ring {
    width: 66px;
    height: 66px;
  }

  .progress-ring::before {
    inset: 5px;
  }

  .progress-ring strong {
    font-size: 16px;
  }

  .progress-ring span {
    margin-top: -18px;
    font-size: 8px;
  }

  .progress-overview {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .progress-meter {
    min-height: 0;
    padding: 14px;
  }

  .progress-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  .progress-page .stat {
    min-height: 58px;
    padding: 9px;
  }

  .progress-page .stat-icon {
    width: 29px;
    height: 29px;
  }

  .mistake-analysis {
    margin-bottom: 10px;
    padding: 16px;
  }

  .analysis-section-head {
    align-items: flex-start;
  }

  .progress-detail .section-head,
  .progress-groups {
    padding: 16px;
  }

  .progress-group + .progress-group {
    margin-top: 20px;
  }

  .progress-lesson {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .progress-lesson-metrics .last-studied {
    grid-column: 1 / -1;
  }

  .progress-lesson-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
  }

  .progress-lesson-actions .btn {
    min-height: 36px;
  }

  .progress-lesson-actions .btn:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .progress-hero-copy > img {
    display: none;
  }

  .progress-hero p {
    max-width: 180px;
  }

  .progress-page .stat-icon {
    display: none;
  }
}

.mistake-empty-state {
  width: min(480px, calc(100% - 32px));
  margin: 64px auto;
  padding: 32px;
  border: 1px solid #dfe4ff;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8faff, #f2fdf7);
  text-align: center;
}

.mistake-empty-state > img {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.1);
}

.mistake-empty-state > span {
  display: block;
  margin-bottom: 5px;
  color: #059669;
  font-size: 11px;
  font-weight: 600;
}

.mistake-empty-state h4 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 19px;
}

.mistake-empty-state p {
  margin: 0 auto;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.mistake-empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.mistake-empty-actions .btn {
  min-width: 108px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 400;
}

@media (max-width: 820px) {
  .question-card-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .question-stats {
    align-self: start;
    justify-self: end;
  }

  .mistake-empty-state {
    width: calc(100% - 28px);
    margin: 36px auto;
    padding: 24px 18px;
  }

  .mistake-empty-state > img {
    width: 54px;
    height: 54px;
  }

  .mistake-empty-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mistake-empty-actions .btn {
    min-width: 0;
    min-height: 38px;
  }
}

/* Keep the lesson header and content in one scrolling surface. */
.main-panel {
  overflow: hidden;
}

.lesson-content-shell {
  height: auto;
  min-height: 0;
  overflow: visible;
}

@media (min-width: 821px) {
  .study-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .study-shell .topbar {
    position: relative;
    flex: 0 0 auto;
  }

  .study-shell .content-shell {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 14px;
  }

  .study-shell .study-layout {
    height: 100%;
    min-height: 0;
    align-items: stretch;
  }

  .study-shell .lesson-sidebar {
    position: static;
    height: 100%;
    max-height: none;
  }

  .study-shell .main-panel {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

/* Final button typography override: keep all action buttons visually consistent. */
button.btn,
.btn,
.tab,
.nav-tab,
.lesson-toolbar-actions .btn,
.lesson-next-action .btn,
.progress-lesson-actions .btn,
.mistake-inline,
.form-actions .btn,
.top-actions .btn {
  font-size: 13px !important;
  font-weight: 400 !important;
}

button.btn.primary,
.btn.primary {
  font-weight: 500 !important;
}

/* Legacy lesson content compatibility and reading rhythm. */
.lesson-content section {
  scroll-margin-top: 16px;
}

.lesson-content section > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f7;
  font-size: 16px;
  line-height: 1.4;
}

.lesson-content section > h3 > i.fa {
  display: block;
  flex: 0 0 4px;
  width: 4px;
  height: 17px;
  margin: 0;
  border-radius: 999px;
  background: var(--lesson-primary, var(--brand));
}

.lesson-content h5 {
  margin: 0 0 7px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.lesson-content .bg-white > h4:first-child,
.lesson-content .bg-light > h4:first-child,
.lesson-content .bg-gray-50 > h4:first-child {
  margin-top: 0;
}

.lesson-content .hidden {
  display: none;
}

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

.lesson-content .flex-wrap {
  flex-wrap: wrap;
}

.lesson-content .flex-shrink-0 {
  flex-shrink: 0;
}

.lesson-content .inline-flex {
  display: inline-flex;
}

.lesson-content .block {
  display: block;
}

.lesson-content .text-left {
  text-align: left;
}

.lesson-content .text-xs {
  font-size: 11px;
}

.lesson-content .text-gray-400 {
  color: #94a3b8;
}

.lesson-content .gap-1 {
  gap: 4px;
}

.lesson-content .gap-3 {
  gap: 10px;
}

.lesson-content .gap-8 {
  gap: 18px;
}

.lesson-content .space-y-5 > * + * {
  margin-top: 15px;
}

.lesson-content .space-y-6 > * + * {
  margin-top: 18px;
}

.lesson-content .space-x-2 > * + * {
  margin-left: 8px;
}

.lesson-content .space-x-3 > * + * {
  margin-left: 10px;
}

.lesson-content .space-x-6 > * + * {
  margin-left: 18px;
}

.lesson-content .space-x-8 > * + * {
  margin-left: 24px;
}

.lesson-content .mb-1 {
  margin-bottom: 4px;
}

.lesson-content .mb-2 {
  margin-bottom: 6px;
}

.lesson-content .mb-5 {
  margin-bottom: 14px;
}

.lesson-content .mb-12,
.lesson-content .mb-16,
.lesson-content .mb-20 {
  margin-bottom: 28px;
}

.lesson-content .mt-2 {
  margin-top: 7px;
}

.lesson-content .mt-4 {
  margin-top: 12px;
}

.lesson-content .mt-6 {
  margin-top: 16px;
}

.lesson-content .mt-0\.5 {
  margin-top: 2px;
}

.lesson-content .ml-1 {
  margin-left: 4px;
}

.lesson-content .ml-2 {
  margin-left: 8px;
}

.lesson-content .ml-6 {
  margin-left: 18px;
}

.lesson-content .mr-4 {
  margin-right: 14px;
}

.lesson-content .p-3 {
  padding: 10px;
}

.lesson-content .px-2 {
  padding-right: 7px;
  padding-left: 7px;
}

.lesson-content .px-3 {
  padding-right: 10px;
  padding-left: 10px;
}

.lesson-content .px-6 {
  padding-right: 16px;
  padding-left: 16px;
}

.lesson-content .py-4 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.lesson-content .pt-6 {
  padding-top: 16px;
}

.lesson-content .pb-6 {
  padding-bottom: 16px;
}

.lesson-content .w-6,
.lesson-content .h-6 {
  width: 22px;
  height: 22px;
}

.lesson-content .w-7,
.lesson-content .h-7 {
  width: 26px;
  height: 26px;
}

.lesson-content .w-8,
.lesson-content .h-8 {
  width: 30px;
  height: 30px;
}

.lesson-content .w-10,
.lesson-content .h-10 {
  width: 34px;
  height: 34px;
}

.lesson-content .w-24 {
  width: 84px;
}

.lesson-content .list-disc {
  list-style: disc;
}

.lesson-content .whitespace-nowrap {
  white-space: nowrap;
}

.lesson-content .rounded-t-lg {
  border-radius: 8px 8px 0 0;
}

.lesson-content :is(
  .pronoun-highlight,
  .adverb-highlight,
  .adjective-highlight,
  .noun-highlight,
  .preposition-highlight,
  .numeral-highlight,
  .verb-highlight,
  .article-highlight,
  .relative-pronoun,
  .subordinator,
  .conjunction
) {
  color: var(--lesson-primary, var(--brand));
  font-weight: 650;
}

.lesson-content :is(.clause-highlight, .antecedent) {
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 10%, white);
  color: color-mix(in srgb, var(--lesson-primary, var(--brand)) 82%, #0f172a);
}

.lesson-content :is(.adverbial-clause, .object-clause, .clause, .restrictive, .non-restrictive) {
  position: relative;
  padding: 0 7px;
}

.lesson-content :is(.adverbial-clause, .object-clause, .clause, .restrictive, .non-restrictive)::before {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: var(--lesson-secondary, var(--lesson-primary, var(--brand)));
  content: "";
}

.lesson-content .main-clause {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f5f9;
}

.lesson-content :is(.tense-icon, .voice-icon, .agree-icon, .compound-icon) {
  display: inline-block;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
}

.lesson-content .sentence-type {
  position: relative;
  padding-left: 18px;
}

.lesson-content .sentence-type::before {
  position: absolute;
  top: 0.42em;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--lesson-primary, var(--brand));
  content: "";
}

.lesson-content .declarative::before {
  background: #3b82f6;
}

.lesson-content .interrogative::before {
  background: #10b981;
}

.lesson-content .imperative::before {
  background: #f59e0b;
}

.lesson-content .exclamatory::before {
  background: #ef4444;
}

.lesson-content .inverted::before {
  background: #8b5cf6;
}

.lesson-content .example-correct {
  border-left: 3px solid #10b981;
}

.lesson-content .example-incorrect {
  border-left: 3px solid #ef4444;
}

.lesson-content .compare-box {
  position: relative;
}

.lesson-content .compare-box::after {
  position: absolute;
  top: 50%;
  right: -13px;
  color: var(--lesson-primary, var(--brand));
  font-weight: 600;
  transform: translateY(-50%);
  content: "→";
}

.lesson-content .time-line {
  position: relative;
}

.lesson-content .time-line::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lesson-primary, var(--brand)) 55%, white);
  content: "";
}

.lesson-content[data-lesson-file="4_tenses.html"] :is(#present, #past, #future) .card-hover > div:first-child {
  padding: 11px 13px;
  border-radius: 8px 8px 0 0;
}

.lesson-content[data-lesson-file="4_tenses.html"] :is(#present, #past, #future) .card-hover > div:first-child h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.lesson-content[data-lesson-file="4_tenses.html"] :is(#present, #past, #future) .card-hover > div:first-child h4 > i.fa {
  display: block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin: 0;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-size: 0;
  opacity: 0.9;
}

.lesson-content[data-lesson-file="4_tenses.html"] :is(#present, #past, #future) .card-hover > div:first-child h4 > i.fa::before {
  content: none;
}

.lesson-content i.fa-check,
.lesson-content i.fa-check-circle {
  display: inline-grid;
  place-items: center;
  color: var(--lesson-primary, var(--brand));
  font-style: normal;
}

.lesson-content i.fa-check::before,
.lesson-content i.fa-check-circle::before {
  content: "✓";
}

.lesson-content .overflow-x-auto {
  max-width: 100%;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

@media (min-width: 821px) and (max-width: 1199px) {
  .lesson-content .md\:grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-content :is(.md\:grid-cols-3, .lg\:grid-cols-3, .lg\:grid-cols-4) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-content .md\:col-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .lesson-content :is(
    .md\:grid-cols-2,
    .md\:grid-cols-3,
    .lg\:grid-cols-3,
    .lg\:grid-cols-4
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-content .md\:col-span-2 {
    grid-column: auto;
  }

  .lesson-content .compare-box::after {
    display: none;
  }

  .lesson-content .overflow-x-auto table {
    min-width: 620px;
  }
}

@media (max-width: 520px) {
  .lesson-content .grid-cols-2,
  .lesson-content .grid-cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-content section > h3 {
    font-size: 15px;
  }

  .lesson-content .bg-white,
  .lesson-content .rounded-xl,
  .lesson-content .shadow-lg,
  .lesson-content .shadow-md {
    border-radius: 8px;
  }
}
