:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --sidebar-width: 240px;
  --page-max-wide: 1480px;
  --page-max-focus: 1180px;
  --page-inline-pad: 28px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #2563eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --text: #0f172a;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,23,42,0.04), 0 3px 10px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.09), 0 1px 4px rgba(15,23,42,0.04);
  --btn-radius-sm: 12px;
  --btn-shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 4px 10px rgba(15,23,42,0.05);
  --btn-shadow-sm-hover: 0 2px 4px rgba(15,23,42,0.05), 0 7px 14px rgba(15,23,42,0.08);
  --btn-shadow-sm-active: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.05);
  --btn-focus-ring: rgba(37,99,235,0.14);
  --btn-secondary-bg: #f8fafc;
  --btn-secondary-hover-bg: #f1f5f9;
  --btn-secondary-border: #dbe4ef;
  --btn-outline-border: rgba(37,99,235,0.32);
  --btn-outline-hover-bg: rgba(37,99,235,0.05);
  --nav-pill-hover-bg: rgba(255,255,255,0.05);
  --nav-pill-hover-border: rgba(255,255,255,0.08);
  --nav-pill-hover-shadow: 0 4px 12px rgba(2,6,23,0.14);
  --nav-pill-active-bg: rgba(255,255,255,0.08);
  --nav-pill-active-border: rgba(148,163,184,0.24);
  --nav-pill-active-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(2,6,23,0.16);
  --btn-primary-height: 40px;
  --btn-primary-radius: 14px;
  --btn-primary-padding-x: 18px;
  --btn-primary-font-size: 13.5px;
  --btn-primary-font-weight: 700;
  --btn-primary-bg: #0066cc;
  --btn-primary-hover-bg: #005bb8;
  --btn-primary-text: #ffffff;
  --btn-primary-shadow: 0 10px 22px rgba(0, 102, 204, 0.18);
  --btn-primary-shadow-hover: 0 14px 26px rgba(0, 102, 204, 0.22);
  --btn-primary-shadow-active: 0 6px 14px rgba(0, 102, 204, 0.14);
  --btn-primary-focus-ring: rgba(0, 102, 204, 0.18);
  --btn-primary-disabled-bg: #dbe4ef;
  --btn-primary-disabled-text: #7c8ca0;
  --btn-primary-disabled-border: #c8d5e3;
}

html[data-theme="blue-light"] {
  --btn-primary-bg: #0066cc;
  --btn-primary-hover-bg: #0052a3;
  --btn-primary-text: #ffffff;
  --btn-primary-shadow: 0 10px 22px rgba(0, 102, 204, 0.18);
  --btn-primary-shadow-hover: 0 14px 26px rgba(0, 102, 204, 0.22);
  --btn-primary-shadow-active: 0 6px 14px rgba(0, 102, 204, 0.14);
  --btn-primary-focus-ring: rgba(0, 102, 204, 0.18);
  --btn-primary-disabled-bg: #dbe4ef;
  --btn-primary-disabled-text: #7c8ca0;
  --btn-primary-disabled-border: #c8d5e3;
  --btn-focus-ring: rgba(0, 102, 204, 0.14);
  --btn-outline-border: rgba(0,102,204,0.28);
  --btn-outline-hover-bg: rgba(0,102,204,0.05);
}

html[data-theme="deep-dark"],
html[data-theme="dark"] {
  --btn-primary-bg: var(--primary);
  --btn-primary-hover-bg: var(--primary-hover);
  --btn-primary-text: #ffffff;
  --btn-primary-shadow: 0 8px 18px rgba(8, 12, 20, 0.22);
  --btn-primary-shadow-hover: 0 10px 20px rgba(8, 12, 20, 0.26);
  --btn-primary-shadow-active: 0 5px 12px rgba(8, 12, 20, 0.18);
  --btn-primary-focus-ring: rgba(59, 130, 246, 0.20);
  --btn-primary-disabled-bg: #30384a;
  --btn-primary-disabled-text: #98a3b8;
  --btn-primary-disabled-border: #3a4357;
  --btn-focus-ring: rgba(59, 130, 246, 0.18);
  --btn-secondary-bg: #1e2431;
  --btn-secondary-hover-bg: #252d3d;
  --btn-secondary-border: #31394b;
  --btn-outline-border: rgba(59,130,246,0.3);
  --btn-outline-hover-bg: rgba(59,130,246,0.08);
  --nav-pill-hover-bg: rgba(255,255,255,0.06);
  --nav-pill-hover-border: rgba(255,255,255,0.1);
  --nav-pill-hover-shadow: 0 4px 12px rgba(0,0,0,0.18);
  --nav-pill-active-bg: rgba(255,255,255,0.09);
  --nav-pill-active-border: rgba(148,163,184,0.24);
  --nav-pill-active-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 6px 14px rgba(0,0,0,0.22);
}

/* ── Dark Mode ───────────────────────────────────────────────────────────── */
body.dark {
  --bg: #0f1117;
  --surface: #1a1d2e;
  --sidebar-bg: #080c14;
  --sidebar-text: #7c85a0;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #2563eb;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f87171;
  --text: #e8eaf0;
  --text-light: #7c85a0;
  --border: #2a2d3e;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.35);
}
body.dark .q-text { background: #141622; border-color: var(--border); }
body.dark .q-instruction { background: #1e2340; }
body.dark .textarea { background: #141622; color: var(--text); border-color: var(--border); }
body.dark .blank-select { background: #1e2340; color: var(--primary); }
body.dark .blank-input { background: #1e2340; color: var(--primary); }
body.dark .choice { background: var(--surface); }
body.dark .choice:hover { background: #1e2340; }
body.dark .choice.selected { background: #1e2340; }
body.dark .reorder-item { background: var(--surface); }
body.dark .audio-widget { background: #1e2340; }
body.dark .recorder-widget { border-color: var(--border); }
body.dark .recorder-widget.recording { background: #2a1a1a; }
body.dark .recorder-widget.done { background: #0f2a1a; }
body.dark .transcript-box { background: #141622; border-color: var(--border); }
body.dark .stat-card { background: var(--surface); }
body.dark .skill-card { background: var(--surface); }
body.dark .skill-card:hover { background: #1e2340; }
body.dark .record-btn.idle { background: #2a2d3e; }
body.dark .tabs { border-color: var(--border); }
body.dark .tab:hover { background: #1e2340; }
body.dark .timer { background: var(--surface); border-color: var(--border); }
body.dark #sidebar { background: var(--sidebar-bg); }
body.dark .nav-item:hover { background: rgba(255,255,255,0.04); }
body.dark #main::-webkit-scrollbar-thumb { background: #2a2d3e; }
body.dark .score-bar-track { background: #2a2d3e; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; }
body.modal-open { overflow: hidden; }

#app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width); background: var(--sidebar-bg);
  display: flex; flex-direction: column; overflow: hidden;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 18px 18px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo-icon { font-size: 20px; }
.logo-text { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.auth-slot-desktop { margin-left: auto; display: flex; align-items: center; }
.auth-user-chip { display: flex; align-items: center; gap: 6px; }

/* 头像圆圈 — 点击退出 */
.auth-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.15s;
  user-select: none;
}
.auth-avatar:hover { opacity: 0.8; transform: scale(1.08); }
.auth-avatar.has-image {
  overflow: hidden;
  padding: 0;
}
.auth-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-login-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

nav { padding: 10px 0 24px; }
.nav-section { margin-bottom: 4px; }
.nav-section-label { margin-top: 16px; }
.nav-divider {
  height: 1px;
  margin: 18px 18px 12px;
  background: rgba(255,255,255,0.08);
}
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #999; padding: 0 18px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 16px; font-size: 14px; color: var(--sidebar-text);
  cursor: pointer; border-radius: 12px; transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; text-decoration: none;
  border: 1px solid transparent; overflow: hidden;
  background: transparent;
  position: relative;
}
.nav-item > .nav-icon,
.nav-group-main > .nav-icon {
  width: 20px;
  min-width: 20px;
  flex-shrink: 0;
}
.nav-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.nav-item-end {
  width: 12px;
  height: 12px;
}
.nav-item:hover {
  background: var(--nav-pill-hover-bg);
  color: #e2e8f0;
  border-color: var(--nav-pill-hover-border);
  box-shadow: var(--nav-pill-hover-shadow);
  transform: translateY(-1px);
}
.nav-item:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: var(--btn-shadow-sm-active);
}
.nav-item.active {
  background: var(--nav-pill-hover-bg);
  color: var(--text);
  border-color: transparent;
  box-shadow: none;
  font-weight: 600;
}
.nav-item.active::before,
.nav-group-toggle.active::before,
.nav-tree-section.is-active .nav-group-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--primary);
  border-radius: 999px;
}
.nav-icon { font-size: 14px; text-align: center; }
.nav-tree-section { margin: 0; }
.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  gap: 12px;
  min-height: 44px;
  height: 44px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  position: relative;
}
.nav-group-toggle:hover {
  background: var(--nav-pill-hover-bg);
  color: #e2e8f0;
  border-color: var(--nav-pill-hover-border);
  box-shadow: var(--nav-pill-hover-shadow);
  transform: translateY(-1px);
}
.nav-group-toggle:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: var(--btn-shadow-sm-active);
}
.nav-group-toggle.active {
  color: var(--text);
  font-weight: 600;
  background: var(--nav-pill-hover-bg);
  border-color: transparent;
  box-shadow: none;
}
.nav-group-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.nav-group-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.nav-group-caret {
  color: rgba(148,163,184,0.72);
  font-size: 12px;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}
.nav-group-items {
  display: none;
  padding: 4px 0 0;
  gap: 2px;
}
.nav-tree-section.is-open .nav-group-items { display: block; }
.nav-subitem {
  display: flex;
  min-height: 44px;
  height: 44px;
  padding: 0 16px 0 48px;
  gap: 12px;
  font-size: 14px;
  margin: 0;
  color: rgba(203,213,225,0.82);
}
.nav-subitem .nav-item-label {
  text-align: left;
  flex: 1;
}
.nav-tree-section.is-active .nav-group-toggle {
  background: var(--nav-pill-hover-bg);
  border-color: transparent;
}
.nav-subitem.active {
  background: var(--nav-pill-hover-bg);
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
}
.nav-item-emphasis {
  color: #e5edf9;
}
.nav-mini-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ef4444;
  margin-left: auto;
  padding: 0;
  line-height: 1;
}

/* MAIN */
#main { flex: 1; overflow-y: auto; padding: 32px 24px 40px; scrollbar-width: none; -ms-overflow-style: none; }
#main::-webkit-scrollbar { width: 0; height: 0; display: none; }
#main::-webkit-scrollbar-thumb { background: transparent; border-radius: 0; }

#page-container {
  width: 100%;
  min-height: 100%;
}

#page-container.page-layout {
  width: min(var(--page-max-wide), calc(100vw - var(--sidebar-width) - 72px));
  margin: 0 auto;
  padding: 0 var(--page-inline-pad) 48px;
}

#page-container.page-layout-wide,
#page-container.page-layout-dashboard {
  max-width: var(--page-max-wide);
}

#page-container.page-layout-focus {
  width: min(var(--page-max-focus), calc(100vw - var(--sidebar-width) - 72px));
  max-width: var(--page-max-focus);
}

/* PAGE HEADER */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.page-header p { font-size: 13.5px; color: var(--text-light); margin-top: 5px; }
.home-dashboard-header {
  align-items: flex-start;
  gap: 20px;
}
.home-dashboard-header > div:first-child {
  min-width: 0;
}
.protected-gate-card {
  width: 100%;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.settings-card {
  margin: 0;
}
.settings-card-wide {
  grid-column: 1 / -1;
}
.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 999px;
  flex-shrink: 0;
}
.lang-btn {
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn:hover {
  color: #f8fafc;
  background: rgba(255,255,255,0.06);
}
.lang-btn.active {
  background: rgba(79,116,220,0.9);
  color: #fff;
}
.dashboard-section { margin-bottom: 28px; }
.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
  opacity: 0.85;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.section-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-light);
}
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  margin-left: 8px; vertical-align: middle;
}
.badge-speaking { background: #dbeafe; color: #1d4ed8; }
.badge-writing { background: #ffe7d6; color: #b45309; }
.badge-reading { background: #fef3c7; color: #92400e; }
.badge-listening { background: #dbeafe; color: #1e40af; }

/* CARDS */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; border: 1px solid var(--border); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text); letter-spacing: 0.1px; }
.continue-card,
.insight-card,
.module-card,
.stats-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}
.continue-card {
  padding: 32px 34px;
}
.hero-main {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.continue-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}
.continue-meta {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.continue-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}
.insight-card {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
}
.compact-card {
  min-height: 0;
  padding: 18px 18px 16px;
}
.insight-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}
.insight-sub {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}
.goal-progress {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 14px;
}
.goal-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}
.insight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--text-light);
  font-size: 13px;
}
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}
.stats-bar-item {
  padding: 20px 24px;
  min-width: 0;
}
.stats-bar-item + .stats-bar-item {
  border-left: 1px solid var(--border);
}
.stats-bar-value {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.stats-bar-text {
  font-size: 15px;
  line-height: 1.3;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.module-card {
  padding: 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}
.module-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,235,0.3);
}
.module-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  font-size: 24px;
  flex-shrink: 0;
}
.module-meta { min-width: 0; }
.module-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.module-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.1px;
}
.module-desc {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light);
}
.module-count {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.module-stats {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-light);
}
.module-actions {
  display: flex;
  margin-top: 16px;
}
.module-actions .btn {
  width: 100%;
  justify-content: center;
}
.practice-task-card.is-disabled {
  opacity: 0.72;
  cursor: default;
}

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

/* STAT CARDS */
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-light); }
.stat-card .stat-icon { font-size: 24px; margin-bottom: 4px; }

/* HOME SKILL CARDS */
.skill-card {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.18s; text-decoration: none;
  display: block; border: 2px solid transparent;
}
.skill-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.skill-card .skill-icon { font-size: 28px; margin-bottom: 10px; }
.skill-card .skill-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.skill-card .skill-desc { font-size: 13px; color: var(--text-light); line-height: 1.4; }
.skill-card .skill-count { font-size: 12px; color: var(--primary); font-weight: 500; margin-top: 8px; }

/* QUESTION AREA */
.question-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.q-number { font-size: 13px; color: var(--text-light); font-weight: 500; }
.q-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 16px; line-height: 1.5; }
.q-instruction {
  background: rgba(37,99,235,0.05); border-left: 3px solid var(--primary);
  padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--primary); margin-bottom: 18px; font-weight: 500;
}
.q-text {
  font-size: 15px; line-height: 1.8; color: var(--text); background: #fafafa;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 20px;
}

/* AUDIO PLAYER */
.audio-widget {
  background: rgba(37,99,235,0.04); border: 1px solid rgba(37,99,235,0.12);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.audio-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white; transition: all 0.15s; flex-shrink: 0;
}
.audio-btn:hover { background: var(--primary-hover); transform: scale(1.05); }
.audio-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.audio-progress { flex: 1; }
.audio-progress-bar { height: 4px; background: #d1d5db; border-radius: 2px; overflow: hidden; cursor: pointer; }
.audio-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.1s; }
.audio-time { font-size: 12px; color: var(--text-light); margin-top: 4px; display: flex; justify-content: space-between; }
.audio-label { font-size: 13px; font-weight: 600; color: var(--primary); }

/* RECORDER */
.recorder-widget {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 28px 24px; text-align: center; margin-bottom: 20px; transition: all 0.2s;
  background: #fafcfe;
}
.recorder-widget.recording { border-color: var(--danger); background: #fff8f8; }
.recorder-widget.done { border-color: #a7f3d0; background: #f0fdf6; }
.recorder-widget.result-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  text-align: left;
}
.recorder-result-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.recorder-result-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #e9f8ee;
  color: #16a34a;
  font-size: 28px;
  flex-shrink: 0;
}
.recorder-result-copy {
  min-width: 0;
}
.recorder-result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.recorder-result-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
}
.result-actions.compact {
  margin-top: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.recorder-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.recorder-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}
.speaking-audio-panel {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.speaking-audio-panel-copy {
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.6;
}
.speaking-audio-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.speaking-upload-btn {
  position: relative;
  overflow: hidden;
}
.speaking-audio-alt {
  font-size: 12px;
  color: var(--text-light);
}
.speaking-audio-preview {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.speaking-audio-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.speaking-audio-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.speaking-audio-preview-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
}
.speaking-audio-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.retry-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.btn-refresh {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(37,99,235,0.4);
}
.btn-refresh:hover {
  background: rgba(37,99,235,0.06);
}
.status-card {
  width: min(720px, 100%);
  margin: 28px auto 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 34px 36px 26px;
  text-align: center;
}
.status-title {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 18px;
}
.status-title strong {
  font-weight: 500;
}
.status-progress {
  width: 100%;
  height: 7px;
  background: #ececf3;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}
.status-progress-fill {
  height: 100%;
  width: 0;
  background: #b9874f;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.status-progress-fill.recording {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}
.status-btn {
  min-width: 132px;
  justify-content: center;
  background: #c79c64;
  color: #fff;
}
.status-btn:hover {
  background: #b9874f;
}
.status-btn.recording {
  background: linear-gradient(135deg, #4f8df0 0%, #2f69cf 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}
.status-btn.recording:hover {
  background: linear-gradient(135deg, #3f80eb 0%, #255ec3 100%);
}
.record-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 24px; transition: all 0.2s; margin-bottom: 10px;
}
.record-btn.idle { background: #f3f4f6; }
.record-btn.recording { background: var(--danger); animation: pulse 1s infinite; }
.record-btn.done { background: #dcfce7; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.record-status { font-size: 14px; color: var(--text-light); }
.record-status.recording { color: var(--danger); font-weight: 600; }
.record-status.done { color: var(--success); font-weight: 600; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 3px; height: 32px; margin: 8px 0; }
.waveform-bar { width: 4px; background: var(--danger); border-radius: 2px; animation: wave 0.8s infinite; }
.waveform-bar:nth-child(2){animation-delay:0.1s} .waveform-bar:nth-child(3){animation-delay:0.2s}
.waveform-bar:nth-child(4){animation-delay:0.3s} .waveform-bar:nth-child(5){animation-delay:0.4s}
@keyframes wave { 0%,100%{height:8px} 50%{height:24px} }

/* TIMER */
.timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; font-size: 14px; font-weight: 600; color: var(--text);
}
.timer.warning { color: var(--warning); border-color: var(--warning); }
.timer.danger { color: var(--danger); border-color: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.5} }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.timer.warning .timer-dot { background: var(--warning); }
.timer.danger .timer-dot { background: var(--danger); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px;
  border-radius: var(--btn-radius-sm); border: 1px solid transparent; cursor: pointer; font-size: 13.5px;
  font-weight: 500; transition: background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
  text-decoration: none; letter-spacing: 0.1px; box-shadow: var(--btn-shadow-sm);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-shadow-sm), 0 0 0 4px var(--btn-focus-ring);
}
.btn-primary {
  min-height: var(--btn-primary-height);
  padding: 0 var(--btn-primary-padding-x);
  border-radius: var(--btn-primary-radius);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: var(--btn-primary-font-size);
  font-weight: var(--btn-primary-font-weight);
  box-shadow: var(--btn-primary-shadow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover-bg);
  box-shadow: var(--btn-primary-shadow-hover);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: var(--btn-primary-shadow-active);
}
.btn-primary:focus-visible {
  box-shadow: var(--btn-primary-shadow), 0 0 0 4px var(--btn-primary-focus-ring);
}
.btn-secondary,
.btn-success,
.btn-danger,
.btn-outline {
  min-height: 38px;
}
.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--text);
  border-color: var(--btn-secondary-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover-bg);
  box-shadow: var(--btn-shadow-sm-hover);
  transform: translateY(-1px);
}
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
  box-shadow: var(--btn-shadow-sm-hover);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-width: 1px;
  border-color: var(--btn-outline-border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--btn-outline-hover-bg);
  border-color: var(--primary);
  box-shadow: var(--btn-shadow-sm-hover);
  transform: translateY(-1px);
}
.btn-secondary:active:not(:disabled),
.btn-success:active:not(:disabled),
.btn-danger:active:not(:disabled),
.btn-outline:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: var(--btn-shadow-sm-active);
}
.btn:disabled {
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-primary:disabled {
  background: var(--btn-primary-disabled-bg);
  color: var(--btn-primary-disabled-text);
  border: 1px solid var(--btn-primary-disabled-border);
  transform: none;
  filter: none;
}
.btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* 2-button nav: Prev left, Next right */
.btn-group:has(> .btn + .btn):not(:has(> .btn:nth-child(3))) > .btn:last-child { margin-left: auto; }
/* 3-button nav: grid layout → [Prev] [Submit] [Next] always on one row */
.btn-group:has(> .btn:nth-child(3)) {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.btn-group:has(> .btn:nth-child(3)) > .btn:first-child { order: 2; justify-self: center; }
.btn-group:has(> .btn:nth-child(3)) > .btn:nth-child(2) { order: 1; justify-self: start; }
.btn-group:has(> .btn:nth-child(3)) > .btn:last-child  { order: 3; justify-self: end; }

/* TEXTAREA */
.textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; line-height: 1.7; color: var(--text);
  resize: vertical; font-family: inherit; transition: border-color 0.15s;
  background: #fff;
}
.textarea:focus { outline: none; border-color: var(--primary); }
.word-count { font-size: 12px; color: var(--text-light); text-align: right; margin-top: 6px; }
.word-count.ok { color: var(--success); font-weight: 500; }
.word-count.warn { color: var(--danger); font-weight: 500; }

/* SCORE DISPLAY */
.score-panel {
  background: #2563eb;
  border-radius: var(--radius); padding: 24px; color: white; margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(37,99,235,0.28);
}
.score-panel .score-big { font-size: 48px; font-weight: 800; line-height: 1; }
.score-panel .score-label { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.score-breakdown { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.score-item { text-align: center; }
.score-item .score-val { font-size: 22px; font-weight: 700; }
.score-item .score-name { font-size: 11px; opacity: 0.75; }

.score-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.score-bar-label { font-size: 13px; color: var(--text); width: 120px; flex-shrink: 0; }
.score-bar-track { flex: 1; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.7s cubic-bezier(0.4,0,0.2,1); }
.score-bar-val { font-size: 13px; font-weight: 600; color: var(--text); width: 36px; text-align: right; }

.speaking-result-shell {
  margin-top: 14px;
}
.speaking-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}
.speaking-result-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.speaking-result-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.result-audio-player {
  width: 260px;
  max-width: 100%;
  height: 38px;
}
.result-audio-empty {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 12px;
}
.speaking-score-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.speaking-score-main,
.speaking-subscore,
.speaking-feedback-card {
  border: 1px solid var(--border);
}
.speaking-score-main {
  padding: 22px;
}
.speaking-score-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}
.speaking-score-value {
  margin-top: 8px;
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}
.speaking-score-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}
.speaking-subscore {
  padding: 20px;
}
.speaking-subscore-label {
  font-size: 13px;
  color: var(--text-light);
}
.speaking-subscore-value {
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}
.transcript-rich {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.transcript-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f5f7fb;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
.transcript-chip.subtle-error {
  background: #fff5f5;
  color: #b45309;
  border: 1px solid #fde2e2;
}
.transcript-empty {
  color: var(--text-light);
  font-style: italic;
}
.speaking-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.issue-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}
.issue-list li + li {
  margin-top: 10px;
}
.ai-suggestion {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.speaking-result-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* CHOICES */
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; font-size: 14px; line-height: 1.5;
}
.choice:hover { border-color: var(--primary); background: rgba(37,99,235,0.04); }
.choice.selected { border-color: var(--primary); background: rgba(37,99,235,0.05); }
.choice.correct { border-color: var(--success); background: #f0fdf4; }
.choice.incorrect { border-color: var(--danger); background: #fff5f5; }
.choice input[type=radio], .choice input[type=checkbox] { margin-top: 2px; accent-color: var(--primary); }

/* BLANKS */
.blank-input {
  display: inline-block; border: none; border-bottom: 2px solid var(--primary);
  background: rgba(37,99,235,0.06); padding: 2px 8px; border-radius: 4px 4px 0 0;
  font-size: 14px; min-width: 80px; color: var(--primary); font-weight: 500;
  outline: none; cursor: pointer;
}
.blank-select {
  border: 1.5px solid rgba(37,99,235,0.35); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 14px; color: var(--primary); background: rgba(37,99,235,0.04);
  cursor: pointer; outline: none;
}

/* REORDER */
.reorder-area { display: flex; gap: 20px; margin-bottom: 20px; }
.reorder-col { flex: 1; }
.reorder-col-title { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.reorder-item {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 8px; cursor: grab; font-size: 13.5px;
  line-height: 1.5; transition: all 0.15s; user-select: none;
}
.reorder-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(59,91,252,0.15); }
.reorder-item.dragging { opacity: 0.5; cursor: grabbing; }
.reorder-drop-zone {
  min-height: 80px; border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.reorder-drop-zone.over { border-color: var(--primary); background: rgba(37,99,235,0.06); }

/* HIGHLIGHT */
.highlightable span { cursor: pointer; border-radius: 3px; padding: 0 2px; transition: background 0.1s; }
.highlightable span:hover { background: #fef9c3; }
.highlightable span.highlighted-wrong { background: #fecaca; color: var(--danger); font-weight: 500; text-decoration: line-through; }
.highlightable span.highlighted-found { background: #bbf7d0; color: #15803d; font-weight: 500; }

/* PROGRESS PAGE */
.progress-ring { position: relative; display: inline-block; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  text-align: center;
}

/* TABS */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 9px 18px; font-size: 14px; font-weight: 500; color: var(--text-light);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--primary); background: rgba(37,99,235,0.06); }


/* ── 灰白 Grey + White (Apple minimal) ───────────────────────────────────── */
body.grey {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --sidebar-bg: #1d1d1f;
  --sidebar-text: #86868b;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #1d1d1f;
  --primary: #1d1d1f;
  --primary-hover: #3d3d3f;
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --text: #1d1d1f;                        /* Black 80%  rgba(0,0,0,0.80) */
  --text-light: rgba(0,0,0,0.48);         /* Black 48%  tertiary text    */
  --border: #d2d2d7;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 3px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
}
body.grey #sidebar { background: #1d1d1f; }
body.grey #mobile-header { background: #1d1d1f; border-color: #3d3d3f; }
body.grey #sidebar::-webkit-scrollbar-thumb { background: #3d3d3f; }
body.grey .logo { border-bottom: 1px solid #3d3d3f; }
body.grey .logo-text, body.grey .logo-icon { color: #ffffff; }
body.grey .nav-label { color: rgba(134,134,139,0.7); }
body.grey .nav-divider { background: #3d3d3f; }
body.grey .nav-item { color: #86868b; }
body.grey .nav-item:hover { background: rgba(255,255,255,0.06); color: #e8e8ed; }
body.grey .nav-item.active { background: rgba(255,255,255,0.14); color: #ffffff; border-color: rgba(255,255,255,0.18); box-shadow: var(--nav-pill-active-shadow); }
body.grey .score-panel { background: #6e6e73; }
body.grey .score-bar-track { background: #d2d2d7; }
body.grey .q-instruction { background: #f0f0f2; color: #1d1d1f; }
body.grey .audio-widget { background: #f0f0f2; }
body.grey .btn-outline:hover { background: #f0f0f2; }
body.grey .choice:hover, body.grey .choice.selected { background: #f0f0f2; }
body.grey .blank-input, body.grey .blank-select { background: #f0f0f2; }
body.grey .reorder-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
body.grey .reorder-drop-zone.over, body.grey .tab:hover { background: #f0f0f2; }
body.grey .module-card:hover { border-color: rgba(29,29,31,0.24); }
body.grey .module-icon { background: #f0f0f2; }
body.grey .goal-progress { background: #d2d2d7; }
body.grey .transcript-chip { background: #f0f0f2; color: var(--text); }
body.grey .transcript-chip.subtle-error { background: #fdf2f8; border-color: #fbcfe8; color: #c9002b; }
body.grey .recorder-widget.done { border-color: #d2d2d7; background: #f5f5f7; }
body.grey .recorder-result-icon { background: #e8e8ed; color: #1d1d1f; }
body.grey .btn-refresh:hover { background: rgba(29,29,31,0.06); }
body.grey .lang-btn:hover { background: #f0f0f2; }
body.grey .stats-bar-item + .stats-bar-item { border-left-color: var(--border); }
/* ── PTE Official Theme (Pearson brand) ───────────────────────────────────── */
body.pte-official {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --sidebar-bg: #1a2f4e;
  --sidebar-text: #8ba7c4;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #0066cc;
  --primary: #0066cc;
  --primary-hover: #0052a3;
  --success: #00875a;
  --warning: #d97706;
  --danger: #d32f2f;
  --text: #1a2f4e;
  --text-light: #5a7a94;
  --border: #ccd9e8;
  --shadow: 0 1px 3px rgba(26,47,78,0.08), 0 3px 10px rgba(26,47,78,0.06);
  --shadow-md: 0 4px 20px rgba(26,47,78,0.12);
}
body.pte-official #mobile-header { background: #1a2f4e; border-color: rgba(255,255,255,0.07); }
body.pte-official #sidebar { background: #1a2f4e; }
body.pte-official .nav-item.active { background: rgba(0,102,204,0.20); border-color: rgba(0,102,204,0.28); box-shadow: var(--nav-pill-active-shadow); }
body.pte-official .nav-item:hover { background: rgba(255,255,255,0.06); }
body.pte-official .score-bar-track { background: #dce8f5; }
body.pte-official .q-instruction { background: #dce8f5; color: #0052a3; }
body.pte-official .logo-text { color: #fff; }
body.pte-official .status-progress-fill { background: #0066cc; }

/* ── Ocean Theme ──────────────────────────────────────────────────────────── */
body.ocean {
  --bg: #f0f9ff;
  --surface: #ffffff;
  --sidebar-bg: #0c2340;
  --sidebar-text: #7eb8d4;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #0891b2;
  --primary: #0891b2;
  --primary-hover: #0e7490;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --text: #0c1a2e;
  --text-light: #5a7a94;
  --border: #bae6fd;
  --shadow: 0 1px 2px rgba(8,145,178,0.06), 0 3px 10px rgba(8,145,178,0.08);
  --shadow-md: 0 4px 20px rgba(8,145,178,0.12);
}
body.ocean #mobile-header { background: #0c2340; border-color: rgba(255,255,255,0.08); }
body.ocean #sidebar { background: #0c2340; }
body.ocean .nav-item.active { background: rgba(8,145,178,0.22); border-color: rgba(8,145,178,0.28); box-shadow: var(--nav-pill-active-shadow); }
body.ocean .score-bar-track { background: #e0f2fe; }
body.ocean .q-instruction { background: #e0f2fe; color: #0e7490; }

/* ── Forest Theme ─────────────────────────────────────────────────────────── */
body.forest {
  --bg: #f0fdf4;
  --surface: #ffffff;
  --sidebar-bg: #052e16;
  --sidebar-text: #6db88a;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #16a34a;
  --primary: #16a34a;
  --primary-hover: #15803d;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --text: #052e16;
  --text-light: #4d7c5e;
  --border: #bbf7d0;
  --shadow: 0 1px 2px rgba(22,163,74,0.06), 0 3px 10px rgba(22,163,74,0.08);
  --shadow-md: 0 4px 20px rgba(22,163,74,0.12);
}
body.forest #mobile-header { background: #052e16; border-color: rgba(255,255,255,0.08); }
body.forest #sidebar { background: #052e16; }
body.forest .nav-item.active { background: rgba(22,163,74,0.22); border-color: rgba(22,163,74,0.28); box-shadow: var(--nav-pill-active-shadow); }
body.forest .score-bar-track { background: #dcfce7; }
body.forest .q-instruction { background: #dcfce7; color: #15803d; }

/* ── Lavender Theme ───────────────────────────────────────────────────────── */
body.lavender {
  --bg: #faf5ff;
  --surface: #ffffff;
  --sidebar-bg: #1e1040;
  --sidebar-text: #a78bce;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #7c3aed;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --text: #1e1040;
  --text-light: #6e5a96;
  --border: #e9d5ff;
  --shadow: 0 1px 2px rgba(124,58,237,0.06), 0 3px 10px rgba(124,58,237,0.08);
  --shadow-md: 0 4px 20px rgba(124,58,237,0.12);
}
body.lavender #mobile-header { background: #1e1040; border-color: rgba(255,255,255,0.08); }
body.lavender #sidebar { background: #1e1040; }
body.lavender .nav-item.active { background: rgba(124,58,237,0.20); border-color: transparent; box-shadow: none; }

body.dark .nav-item.active,
body.dark .nav-subitem.active,
body.dark .nav-group-toggle.active,
body.grey .nav-item.active,
body.grey .nav-subitem.active,
body.grey .nav-group-toggle.active,
body.pte-official .nav-item.active,
body.pte-official .nav-subitem.active,
body.pte-official .nav-group-toggle.active,
body.ocean .nav-item.active,
body.ocean .nav-subitem.active,
body.ocean .nav-group-toggle.active,
body.forest .nav-item.active,
body.forest .nav-subitem.active,
body.forest .nav-group-toggle.active,
body.lavender .nav-item.active,
body.lavender .nav-subitem.active,
body.lavender .nav-group-toggle.active {
  color: #f8fafc;
  border-color: transparent;
  box-shadow: none;
}

body.dark .nav-item:hover,
body.dark .nav-group-toggle:hover,
body.grey .nav-item:hover,
body.grey .nav-group-toggle:hover,
body.pte-official .nav-item:hover,
body.pte-official .nav-group-toggle:hover,
body.ocean .nav-item:hover,
body.ocean .nav-group-toggle:hover,
body.forest .nav-item:hover,
body.forest .nav-group-toggle:hover,
body.lavender .nav-item:hover,
body.lavender .nav-group-toggle:hover {
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;
}
body.lavender .score-bar-track { background: #ede9fe; }
body.lavender .q-instruction { background: #ede9fe; color: #6d28d9; }

.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* SECTION DIVIDER */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* TRANSCRIPT */
.transcript-box {
  background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 14px; line-height: 1.8; min-height: 60px;
  color: var(--text);
}
.transcript-box .word-correct { color: var(--success); }
.transcript-box .word-wrong { color: var(--danger); text-decoration: underline; }
.transcript-box .word-missing { color: var(--warning); font-style: italic; }

/* RESPONSIVE */
@media (max-width: 900px) {
  #sidebar { width: 56px; min-width: 56px; }
  .logo-text, .nav-label, .nav-item span:not(.nav-icon) { display: none; }
  .nav-item { padding: 10px; justify-content: center; }
  #main { padding: 16px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: auto; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .dashboard-header { align-items: flex-start; }
  .speaking-result-top,
  .speaking-result-tools,
  .speaking-result-actions { align-items: stretch; }
  .speaking-result-top,
  .speaking-feedback-grid,
  .speaking-score-grid { grid-template-columns: 1fr; }
  .speaking-result-top { flex-direction: column; }
  .recorder-widget.result-state {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .recorder-result-main {
    flex-direction: column;
    text-align: center;
  }
  .result-actions.compact {
    flex-wrap: wrap;
    justify-content: center;
  }
  .result-audio-player,
  .result-audio-empty { width: 100%; min-width: 0; }
  .stats-bar-item:nth-child(3),
  .stats-bar-item:nth-child(4) { border-top: 1px solid var(--border); }
  .stats-bar-item:nth-child(3) { border-left: none; }
  .module-grid { grid-template-columns: 1fr; }
}

/* ── Mobile Header ──────────────────────────────────────────────────────────── */
#mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--sidebar-bg);
  z-index: 250;
  padding: 0 12px;
  align-items: center;
  grid-template-columns: 44px minmax(0, 1fr);
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#hamburger-btn {
  background: none; border: none; color: #fff;
  cursor: pointer; padding: 10px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
}
#hamburger-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.sidebar-logo-img-wrap {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: 0.85;
}
.mobile-logo-text {
  display: block;
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.2px;
  text-align: center;
  white-space: nowrap;
}
.mobile-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  width: auto;
  justify-self: end;
}
#mobile-lang-slot {
  display: flex;
  align-items: center;
  min-width: 0;
}
#mobile-lang-slot:empty {
  display: none !important;
}
#theme-toggle,
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#theme-toggle {
  margin-left: auto;
}

#theme-toggle svg,
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

#theme-toggle:hover,
.theme-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 8px 18px rgba(5, 13, 31, 0.18);
}

#theme-toggle:active,
.theme-toggle-btn:active {
  transform: translateY(0);
  background: rgba(255,255,255,0.12);
}

body.dark #theme-toggle,
body.dark .theme-toggle-btn {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body.dark #theme-toggle:hover,
body.dark .theme-toggle-btn:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}
.mobile-lang-btn {
  min-width: 42px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.auth-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 164px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 400;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  will-change: transform, opacity;
}
.auth-user-chip-mobile.is-open .auth-dropdown-menu {
  display: grid;
  gap: 6px;
  animation: authDropdownIn 180ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-dropdown-item {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.auth-dropdown-item:hover {
  background: var(--bg);
}
.auth-dropdown-lang {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.auth-dropdown-mini {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.auth-dropdown-mini.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

@keyframes authDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Drawer Overlay ─────────────────────────────────────────────────────────── */
#drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
#drawer-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Bottom Navigation ─────────────────────────────────────────────────────── */
#bottom-nav { display: none; }

/* ── Mobile Breakpoint ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .home-zone {
    margin-top: 8px !important;
  }

  .home-overview-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .home-overview-card,
  .home-overview-card-compact {
    min-height: 68px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    gap: 4px !important;
  }

  .home-overview-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 13px;
  }

  .home-overview-label {
    font-size: 10.5px !important;
    line-height: 1.3;
  }

  .home-overview-value {
    font-size: 22px !important;
    letter-spacing: -0.6px;
  }

  .home-focus-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .home-focus-panel,
  .home-recommend-panel {
    padding: 8px !important;
    border-radius: 16px !important;
  }

  .home-focus-hero,
  .home-focus-hero-compact {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 14px !important;
    gap: 6px !important;
  }

  .home-focus-progress {
    font-size: 24px !important;
  }

  .home-focus-latest {
    font-size: 11.5px !important;
    line-height: 1.45 !important;
  }

  .home-goal-progress {
    height: 6px !important;
    margin-top: 2px !important;
  }

  .home-recommend-stack {
    margin-top: 4px !important;
    gap: 6px !important;
  }

  .home-recommend-card,
  .home-recommend-card-compact {
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }

  .home-recommend-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 13px;
  }

  .home-recommend-card-name {
    margin-top: 6px !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
  }

  .home-recommend-card-actions {
    padding-top: 8px !important;
  }

  .home-recommend-card-actions .btn {
    width: 100%;
  }

  #mobile-header { display: grid; }

  #drawer-overlay { display: block; }

  /* Sidebar → slide-in drawer */
  #sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    height: 100% !important;
    width: 260px !important; min-width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 300;
  }
  #sidebar.drawer-open { transform: translateX(0); }

  /* Restore text hidden by 900px rule */
  .logo-text { display: block !important; }
  .nav-label { display: block !important; }
  .nav-item span:not(.nav-icon),
  .nav-group-main span:not(.nav-icon),
  .nav-group-caret,
  .nav-mini-badge { display: inline !important; }
  .nav-item {
    padding: 9px 14px !important;
    justify-content: center !important;
  }
  .nav-group-toggle {
    padding: 9px 14px !important;
    justify-content: center !important;
  }
  .nav-subitem { padding-left: 38px !important; }

  /* App layout — full height adaptive */
  #app { flex-direction: column; }
  #main {
    width: 100% !important;
    padding: 68px 14px calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex;
    flex-direction: column;
  }
  /* Page container — natural flow, no forced stretching on mobile */
  #page-container {
    flex: none;
    display: block;
  }
  #page-container > .card:last-of-type {
    flex: none;
  }
  #page-container > .card:last-of-type .section-divider ~ * { margin-top: 0; }
  #page-container > .card:last-of-type hr.section-divider { margin-top: 0; }

  /* Bottom Nav */
  #bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(15,29,54,0.07);
    z-index: 150;
    padding: 6px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  }
  body.dark #bottom-nav {
    background: rgba(15,17,23,0.96);
    border-top-color: rgba(255,255,255,0.06);
  }
  .bottom-tab {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    background: none; border: none;
    cursor: pointer; padding: 2px 0;
    color: #b0bdd0;
    font-size: 10px; font-weight: 500;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-tab.active { color: #0f1d36; font-weight: 600; }
  body.dark .bottom-tab.active { color: #e8eaf0; }
  .bottom-tab-icon {
    width: 44px; height: 28px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.18s;
  }
  .bottom-tab-icon svg { width: 22px; height: 22px; }
  .bottom-tab.active .bottom-tab-icon { background: rgba(15,29,54,0.09); }
  body.dark .bottom-tab.active .bottom-tab-icon { background: rgba(255,255,255,0.08); }
  .bottom-tab-label { font-size: 10px; letter-spacing: 0.2px; }

  /* Grid adjustments */
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  .hero-grid { grid-template-columns: 1fr !important; }
  .hero-side { grid-template-rows: auto !important; }
  .stats-bar { grid-template-columns: 1fr 1fr !important; }

  /* Module grid: 2 columns */
  .module-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .module-card {
    padding: 14px 12px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .module-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .module-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
    border-radius: 10px !important;
  }
  .module-title { font-size: 13px !important; }
  .module-title-row { gap: 4px !important; }
  .module-desc { display: none !important; }
  .module-count {
    margin-top: 8px !important;
    font-size: 11px !important;
  }
  .module-stats {
    margin-top: 4px !important;
    font-size: 11px !important;
  }
  .module-actions { margin-top: auto !important; padding-top: 10px !important; }
  .module-actions .btn {
    font-size: 12px !important;
    padding: 8px 10px !important;
    min-height: 36px !important;
  }
  .badge {
    font-size: 10px !important;
    padding: 2px 7px !important;
    margin-left: 0 !important;
  }

  /* Compact status countdown card */
  .status-card {
    margin: 10px auto 8px !important;
    padding: 14px 16px 12px !important;
  }
  .status-title { font-size: 13.5px !important; margin-bottom: 10px !important; }
  .status-progress { margin-bottom: 12px !important; height: 5px !important; }
  .status-btn { min-width: 100px !important; min-height: 38px !important; font-size: 13px !important; }

  /* Page header */
  .page-header { margin-bottom: 14px !important; }
  .page-header h1 { font-size: 19px !important; }
  .page-header > p { display: none !important; }
  /* Question content spacing */
  .q-instruction { padding: 10px 14px !important; font-size: 13px !important; margin-bottom: 14px !important; }
  .q-text {
    padding: 14px 16px !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    margin-bottom: 14px !important;
  }
  .section-divider { margin: 16px 0 !important; }
  .recorder-widget { padding: 18px !important; }
  .question-nav { margin-bottom: 12px !important; }
  .card { padding: 20px 18px !important; }

  /* Progress page */
  .grid-2 { grid-template-columns: 1fr !important; }
  /* Stat cards: icon left, value+label right, no wrapping */
  .stat-card {
    display: grid !important;
    grid-template-columns: 36px 1fr !important;
    grid-template-rows: auto auto auto !important;
    align-items: center !important;
    padding: 14px 12px !important;
    gap: 0 10px !important;
    flex-direction: unset !important;
  }
  .stat-card .stat-icon {
    grid-column: 1 !important; grid-row: 1 / 4 !important;
    font-size: 26px !important; margin-bottom: 0 !important;
    align-self: center !important; text-align: center !important;
  }
  .stat-card .stat-value {
    grid-column: 2 !important; grid-row: 1 !important;
    font-size: 26px !important; line-height: 1.1 !important;
    align-self: end !important;
  }
  .stat-card .stat-label {
    grid-column: 2 !important; grid-row: 2 !important;
    font-size: 10.5px !important; text-transform: none !important;
    letter-spacing: 0 !important; white-space: nowrap !important;
    overflow: hidden !important; text-overflow: ellipsis !important;
    align-self: start !important;
  }
  .stat-card .stat-sub {
    grid-column: 2 !important; grid-row: 3 !important;
    font-size: 10px !important; white-space: nowrap !important;
  }
  /* Score bar: shrink label width */
  .score-bar-label { width: 105px !important; font-size: 11px !important; }
  .score-bar-val { font-size: 11px !important; }

  /* Toast above bottom nav */
  .toast { bottom: 72px !important; right: 14px !important; }

  /* Larger touch targets for buttons */
  .btn { min-height: 42px; }
  .btn-primary {
    min-height: var(--btn-primary-height);
    font-size: var(--btn-primary-font-size);
  }
  .record-btn { min-height: 48px !important; }

}


/* AUTH MODAL */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
}
.auth-modal-overlay.hidden { display: none; }
.auth-modal {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 26px;
  position: relative;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.auth-modal-header { margin-bottom: 18px; }
.auth-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 18px;
}
.auth-tab {
  min-width: 110px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.auth-form { display: grid; gap: 10px; }
.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.auth-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.08);
}
.auth-message {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-message.hidden { display: none; }
.auth-message.error {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.auth-message.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* Google / OAuth 登录按钮 */
.google-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  height: 44px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 4px;
}
.google-login-btn:hover {
  background: var(--hover, rgba(0,0,0,0.04));
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 分隔线 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-muted, #888);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #e2e8f0);
}

@media (max-width: 640px) {
  .auth-slot-desktop { display: none; }
  .auth-user-chip {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .auth-modal {
    padding: 22px 18px;
    border-radius: 18px;
  }
}

.logout-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
}
.logout-dialog-overlay.hidden {
  display: none;
}
.logout-dialog {
  width: min(360px, 100%);
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  outline: none;
}
.logout-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.logout-dialog-body {
  padding-right: 28px;
}
.logout-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.logout-dialog-copy {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}
.logout-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.logout-dialog-actions .btn {
  min-width: 96px;
}

.exam-goal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.exam-goal-modal-overlay.hidden {
  display: none;
}

.exam-goal-modal {
  position: relative;
  width: min(100%, 420px);
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 22px;
}

.exam-goal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.exam-goal-header {
  margin-bottom: 16px;
}

.exam-goal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.exam-goal-copy {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.exam-goal-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.exam-goal-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exam-goal-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.exam-goal-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.exam-goal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .exam-goal-modal-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .exam-goal-modal {
    width: 100%;
    border-radius: 22px 22px 18px 18px;
    padding: 20px 16px 16px;
  }

  .exam-goal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1a1d2e; color: white;
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px;
  box-shadow: var(--shadow-md); z-index: 1000; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }

/* LOADING */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── MOCK TEST STRUCTURE TABLE ───────────────────────────────────────────── */
.mt-part-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-weight: 600;
}
.mt-part-speaking { background: color-mix(in srgb, #2563eb 10%, transparent); }
.mt-part-reading  { background: color-mix(in srgb, #d97706 10%, transparent); }
.mt-part-listening{ background: color-mix(in srgb, #475569 12%, transparent); }
.mt-part-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
}
.mt-part-speaking .mt-part-badge { background: #2563eb; }
.mt-part-reading  .mt-part-badge { background: #d97706; }
.mt-part-listening .mt-part-badge { background: #475569; }
.mt-part-name { flex: 1; font-size: 14px; color: var(--text); }
.mt-part-time { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.mt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 4px;
}
.mt-table thead tr {
  background: var(--bg);
}
.mt-table th {
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.mt-table th:not(:first-child) { text-align: center; }
.mt-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.mt-table td:not(:first-child) { text-align: center; color: var(--text-light); font-size: 12px; }
.mt-table tbody tr:last-child td { border-bottom: none; }
.mt-table tbody tr:hover { background: var(--bg); }
.mt-row-divider td { border-top: 2px solid var(--border); }

/* ── WALKMAN ─────────────────────────────────────────────────────────────── */
.wm-player {
  margin-bottom: 14px;
}
.wm-now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.wm-track-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}
.wm-track-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.wm-track-meta {
  font-size: 12px;
  color: var(--text-light);
}
.wm-text-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  min-height: 60px;
  max-height: 120px;
  overflow-y: auto;
}
.wm-text-preview {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.wm-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.wm-progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.wm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.2s linear;
}
.wm-time {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
}
.wm-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wm-speed-btns {
  display: flex;
  gap: 4px;
}
.wm-speed-btn {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
}
.wm-speed-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.wm-main-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wm-ctrl-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.15s;
}
.wm-ctrl-btn:hover { background: var(--bg); }
.wm-play-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
  transition: background 0.15s;
}
.wm-play-btn:hover { background: var(--primary-hover); }
.wm-loop-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.15s;
}
.wm-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.wm-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.wm-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.wm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.wm-list-item:hover { background: var(--bg); }
.wm-list-item.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.wm-li-icon { font-size: 20px; flex-shrink: 0; }
.wm-li-info { flex: 1; min-width: 0; }
.wm-li-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wm-li-meta { font-size: 11px; color: var(--text-light); }
.wm-li-dur { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   NEW LANDING / DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared page wrapper ───────────────────────────────────────────────── */
.landing-page,
.progress-page,
.practice-page {
  width: 100%;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
  gap: 56px;
  align-items: center;
  padding: 32px 0 52px;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-light);
  margin-bottom: 28px;
  max-width: 400px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-link {
  font-size: 13px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--text); }

/* ── Demo score card ───────────────────────────────────────────────────── */
.demo-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: var(--shadow-md);
}

.demo-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 18px;
}

.demo-score-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 2px;
}

.demo-score-number {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text);
  line-height: 1;
}

.demo-score-suffix {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 500;
}

.demo-score-type {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.demo-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

.demo-breakdown { display: flex; flex-direction: column; gap: 11px; }

.demo-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-breakdown-label {
  font-size: 12px;
  color: var(--text-light);
  width: 96px;
  flex-shrink: 0;
}

.demo-breakdown-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.demo-breakdown-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
}

.demo-breakdown-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Logged-in hero variant ────────────────────────────────────────────── */
.hero-welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-welcome-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

.hero-welcome-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.hero-welcome-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.hero-stat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.hero-stat-pill strong { color: var(--text); }

/* ── Section headers ───────────────────────────────────────────────────── */
.landing-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.section-heading {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 6px;
}

.section-subheading {
  font-size: 13.5px;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.55;
}

/* ── Feature cards ─────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
}

.feature-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
}

/* ── Practice module overview cards ───────────────────────────────────── */
.modules-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.module-overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 22px 20px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  position: relative;
}

.module-overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.module-overview-card.mod-featured {
  border-color: rgba(37, 99, 235, 0.22);
}

.mod-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mod-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.mod-icon-speaking  { background: rgba(37, 99, 235, 0.10); }
.mod-icon-writing   { background: rgba(5, 150, 105, 0.10); }
.mod-icon-reading   { background: rgba(217, 119, 6, 0.10); }
.mod-icon-listening { background: rgba(124, 58, 237, 0.10); }

.mod-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.mod-card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}

.mod-badge-ai {
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
}

.mod-card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
  margin-bottom: 14px;
}

.mod-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}

.mod-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-light);
  background: var(--bg);
}

.mod-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mod-explore-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mod-explore-btn:hover { text-decoration: underline; }

.mod-count-label {
  font-size: 11px;
  color: var(--text-light);
}

/* ── How it works ──────────────────────────────────────────────────────── */
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

.how-step {
  padding: 0 16px 0 0;
  position: relative;
}

.how-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20px;
  width: 1px;
  height: 40px;
  background: var(--border);
}

.step-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-num::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.10);
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
}

/* ── Login teaser ──────────────────────────────────────────────────────── */
.login-teaser {
  background: var(--surface);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 20px;
  padding: 36px 40px;
  text-align: center;
  margin-bottom: 12px;
}

.login-teaser-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.login-teaser-desc {
  font-size: 14px;
  color: var(--text-light);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.login-teaser-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── My Progress page ──────────────────────────────────────────────────── */
.progress-welcome {
  padding: 4px 0 28px;
}

.progress-welcome-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.progress-welcome-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 4px;
}

.progress-welcome-sub {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-light);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.summary-pill strong { color: var(--text); }

/* ── Stats overview grid ───────────────────────────────────────────────── */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-num-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
}

.stat-num-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.stat-num-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-num-sub {
  font-size: 11px;
  color: var(--text-light);
}

/* ── Recent attempts & focus areas shared card ──────────────────────────── */
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.dashboard-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

/* ── Attempt rows ──────────────────────────────────────────────────────── */
.attempt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.attempt-row:last-child { border-bottom: none; }

.attempt-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.attempt-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.attempt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attempt-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

.attempt-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.attempt-score-sub {
  font-size: 10px;
  color: var(--text-light);
  text-align: right;
}

/* ── Empty state card ──────────────────────────────────────────────────── */
.empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 16px;
}

.empty-card-icon {
  width: 44px;
  height: 44px;
  background: var(--bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 20px;
}

.empty-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.empty-card-desc {
  font-size: 13px;
  color: var(--text-light);
  max-width: 300px;
  margin: 0 auto 16px;
  line-height: 1.55;
}

/* ── Focus areas ───────────────────────────────────────────────────────── */
.focus-areas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.focus-area-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}

.focus-area-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.focus-area-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.focus-area-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.focus-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.focus-bar-fill {
  height: 100%;
  border-radius: 99px;
}

/* ── Study plan card ───────────────────────────────────────────────────── */
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.plan-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.plan-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

.plan-items { display: flex; flex-direction: column; gap: 8px; }

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-light);
}

.plan-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ── Practice overview page ────────────────────────────────────────────── */
.practice-header { padding: 4px 0 28px; }

.practice-section { margin-bottom: 32px; }

.practice-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.practice-section-title span {
  font-weight: 400;
  color: var(--text-light);
  font-size: 13px;
  margin-left: 6px;
}

.practice-tasks-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.prediction-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.prediction-filter-bar .btn {
  min-width: 128px;
  justify-content: center;
  margin-left: 0;
}

.practice-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.14s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.practice-task-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.practice-task-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.practice-task-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.practice-task-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.practice-task-count {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.practice-task-score {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px 0 32px;
  }

  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; max-width: none; }

  .features-grid { grid-template-columns: 1fr; gap: 16px; }

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

  .how-steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .how-step::after { display: none; }

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

  .stats-overview-grid { grid-template-columns: repeat(2, 1fr); }

  .focus-areas-grid { grid-template-columns: 1fr; }

  .practice-tasks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prediction-filter-bar .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 640px) {
  #main { padding: 24px 16px 80px; }
  #page-container.page-layout,
  #page-container.page-layout-focus {
    width: 100%;
    max-width: none;
    padding: 0 0 32px;
  }
  .landing-page, .progress-page, .practice-page { width: 100%; }
  .modules-overview-grid,
  .practice-tasks-grid {
    grid-template-columns: 1fr;
  }
  .prediction-filter-bar .btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENHANCED MY PROGRESS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page header ───────────────────────────────────────────────────────── */
.prog-header {
  padding: 8px 0 36px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.prog-header-left {}

.prog-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.prog-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.2;
}

.prog-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.5;
}

.prog-header-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prog-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-light);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.prog-pill strong { color: var(--text); }

.prog-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 8px;
}

/* ── Stats cards ───────────────────────────────────────────────────────── */
.prog-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.prog-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
}

.prog-stat-card.highlight {
  background: var(--surface);
  border-color: rgba(37,99,235,0.18);
}

.prog-stat-icon {
  font-size: 18px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.7;
}

.prog-stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.2px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}

.prog-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-light);
}

.prog-stat-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.prog-stat-sample {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  display: inline-block;
  margin-top: 6px;
}

/* ── Two-column layout ─────────────────────────────────────────────────── */
.prog-grid-2 {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 16px;
}

.prog-grid-2-full {
  grid-column: 1 / -1;
}

/* ── Shared dashboard card ─────────────────────────────────────────────── */
.prog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.prog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}

.prog-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.prog-card-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* ── Trend chart ───────────────────────────────────────────────────────── */
.trend-chart-wrap {
  position: relative;
  width: 100%;
  height: 140px;
}

.trend-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding-bottom: 24px;
  position: relative;
}

.trend-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.trend-bar {
  width: 100%;
  border-radius: 5px 5px 2px 2px;
  min-height: 4px;
  transition: opacity 0.15s;
  cursor: default;
  position: relative;
}

.trend-bar:hover { opacity: 0.8; }

.trend-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
  line-height: 1;
}

.trend-bar-date {
  font-size: 9px;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
  margin-top: 4px;
}

.trend-baseline {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.trend-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-light);
}

.trend-empty-icon {
  font-size: 28px;
  opacity: 0.4;
}

.trend-empty-text {
  font-size: 13px;
}

/* ── Recent attempts ───────────────────────────────────────────────────── */
.prog-attempt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.prog-attempt-row:last-child { border-bottom: none; }

.prog-attempt-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.prog-attempt-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.prog-attempt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prog-attempt-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.prog-attempt-score {
  text-align: right;
  flex-shrink: 0;
}

.prog-score-big {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.prog-score-denom {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Focus areas ───────────────────────────────────────────────────────── */
.prog-focus-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prog-focus-item {}

.prog-focus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prog-focus-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.prog-focus-score {
  font-size: 13px;
  font-weight: 700;
}

.prog-focus-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.prog-focus-bar {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.prog-focus-bar-fill {
  height: 100%;
  border-radius: 99px;
}

/* ── Study plan ────────────────────────────────────────────────────────── */
.prog-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prog-plan-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.prog-plan-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(37,99,235,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.prog-plan-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.prog-plan-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.prog-plan-text strong { font-weight: 600; }

/* ── Auth gate (logged out full-page) ──────────────────────────────────── */
.prog-auth-gate {
  background: var(--surface);
  border: 1px solid rgba(37,99,235,0.14);
  border-radius: 20px;
  padding: 40px 36px;
  text-align: center;
  margin-bottom: 20px;
}

.prog-auth-gate-icon {
  font-size: 36px;
  margin-bottom: 14px;
  opacity: 0.7;
}

.prog-auth-gate-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.prog-auth-gate-desc {
  font-size: 14px;
  color: var(--text-light);
  max-width: 360px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.prog-auth-gate-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Empty states ──────────────────────────────────────────────────────── */
.prog-empty {
  padding: 28px 16px;
  text-align: center;
}

.prog-empty-icon {
  font-size: 28px;
  opacity: 0.4;
  margin-bottom: 10px;
}

.prog-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.prog-empty-desc {
  font-size: 12px;
  color: var(--text-light);
  max-width: 260px;
  margin: 0 auto 14px;
  line-height: 1.5;
}

/* ── Home dashboard shell ──────────────────────────────────────────────── */
.home-dashboard-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 40px;
}

.home-dashboard-header {
  margin-bottom: 26px;
}

.home-dashboard-header .eyebrow {
  margin-bottom: 10px;
}

.home-mobile-primary-action {
  display: none;
}

.home-zone {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.home-zone + .home-zone {
  margin-top: 16px;
}

.home-directory-shell {
  padding-bottom: 56px;
}

.home-directory-header {
  align-items: flex-start;
}

.home-directory-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.home-directory-section {
  margin-top: 18px;
}

.home-directory-section-hero {
  margin-top: 0;
}

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

.home-directory-section-heading h2 {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.home-directory-section-heading p {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--text-light);
  line-height: 1.7;
}

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

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

.home-directory-grid-primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: none;
  margin: 0;
}

.home-directory-grid-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.home-directory-card {
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 16px;
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  overflow: hidden;
}

.home-directory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15,23,42,0.14);
  box-shadow: var(--shadow-lg);
}

.home-directory-card-primary {
  min-height: 116px;
  padding: 14px;
  border-radius: 22px;
  aspect-ratio: auto;
}

.home-directory-card-primary .home-directory-card-top {
  gap: 10px;
}

.home-directory-card-primary .home-directory-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 16px;
}

.home-directory-card-primary h3 {
  font-size: 15px;
}

.home-directory-card-primary .home-directory-card-stat {
  margin-top: 4px;
  font-size: 9px;
}

.home-directory-card-primary p {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.home-directory-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.home-directory-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255,255,255,0.78);
  box-shadow: inset 0 0 0 1px rgba(148,163,184,0.18);
  flex-shrink: 0;
}

.home-directory-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.home-directory-card-stat {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-directory-card p {
  margin: 10px 0 0;
  color: var(--text-light);
  line-height: 1.55;
  font-size: 12px;
}

.home-directory-card-mini-desc {
  display: none;
}

.home-directory-card-primary {
  background: #f8fafc;
}

.home-directory-card-secondary,
.home-directory-card-tool {
  min-height: 136px;
  background: #f8fafc;
}

.home-directory-card-secondary {
  min-height: 116px;
  padding: 14px;
  border-radius: 22px;
}

.home-directory-card-secondary .home-directory-card-top {
  gap: 10px;
}

.home-directory-card-secondary .home-directory-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 15px;
}

.home-directory-card-secondary h3 {
  font-size: 15px;
}

.home-directory-card-secondary .home-directory-card-stat {
  margin-top: 4px;
  font-size: 9px;
}

.home-directory-card-secondary p {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
}

body.dark .home-directory-card,
html[data-theme="pink-dark"] .home-directory-card,
html[data-theme="deep-dark"] .home-directory-card,
html[data-theme="dark"] .home-directory-card {
  border-color: rgba(124,133,160,0.22);
  background: #171b27;
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}

body.dark .home-directory-card:hover,
html[data-theme="pink-dark"] .home-directory-card:hover,
html[data-theme="deep-dark"] .home-directory-card:hover,
html[data-theme="dark"] .home-directory-card:hover {
  border-color: rgba(124,133,160,0.34);
  box-shadow: 0 18px 36px rgba(0,0,0,0.34);
}

body.dark .home-directory-card-primary,
html[data-theme="pink-dark"] .home-directory-card-primary,
html[data-theme="deep-dark"] .home-directory-card-primary,
html[data-theme="dark"] .home-directory-card-primary {
  background: #171b27;
}

body.dark .home-directory-card-secondary,
body.dark .home-directory-card-tool,
html[data-theme="pink-dark"] .home-directory-card-secondary,
html[data-theme="pink-dark"] .home-directory-card-tool,
html[data-theme="deep-dark"] .home-directory-card-secondary,
html[data-theme="deep-dark"] .home-directory-card-tool,
html[data-theme="dark"] .home-directory-card-secondary,
html[data-theme="dark"] .home-directory-card-tool {
  background: #161a28;
}

body.dark .home-directory-card-icon,
html[data-theme="pink-dark"] .home-directory-card-icon,
html[data-theme="deep-dark"] .home-directory-card-icon,
html[data-theme="dark"] .home-directory-card-icon {
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(124,133,160,0.18);
}

html[data-theme="pink-dark"] .home-directory-card h3,
html[data-theme="deep-dark"] .home-directory-card h3,
html[data-theme="dark"] .home-directory-card h3,
body.dark .home-directory-card h3 {
  color: #f3f4f8;
}

html[data-theme="pink-dark"] .home-directory-card p,
html[data-theme="pink-dark"] .home-directory-card-stat,
html[data-theme="deep-dark"] .home-directory-card p,
html[data-theme="deep-dark"] .home-directory-card-stat,
html[data-theme="dark"] .home-directory-card p,
html[data-theme="dark"] .home-directory-card-stat,
body.dark .home-directory-card p,
body.dark .home-directory-card-stat {
  color: #a8b0c4;
}

.home-progress-banner {
  display: none; /* desktop: hidden, shown only on mobile via media query */
}

.home-zone-focus,
.home-zone-lower {
  background: transparent;
}

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

.home-overview-card,
.home-focus-panel,
.home-recommend-panel,
.home-recent-card,
.home-shortcuts-card {
  border: 1px solid rgba(148,163,184,0.18);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.home-overview-card {
  min-height: 128px;
  padding: 24px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.home-overview-card-compact {
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 18px;
  gap: 8px;
}

.home-overview-icon,
.home-focus-metric-icon,
.home-recommend-card-icon,
.home-shortcut-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-light);
  font-size: 18px;
  flex-shrink: 0;
}

.home-overview-label,
.home-focus-metric-label,
.home-shortcut-desc,
.home-recommend-links-label {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

.home-overview-value {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.4px;
  color: var(--text);
}

.home-focus-grid,
.home-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.home-lower-grid {
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
}

.home-focus-panel,
.home-recommend-panel,
.home-recent-card,
.home-shortcuts-card {
  padding: 26px 28px;
  border-radius: 24px;
}

.home-recent-card .prog-card-header {
  margin-bottom: 12px;
}

.home-focus-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 18px;
}

.home-focus-hero {
  min-height: 336px;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.home-focus-hero-compact {
  min-height: 0;
  padding: 16px 18px;
  gap: 10px;
}

.home-focus-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
}

.home-focus-progress {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2.4px;
  line-height: 0.95;
  color: var(--text);
}

.home-focus-progress span {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: -0.4px;
}

.home-focus-copy {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.home-goal-progress {
  margin-top: 20px;
  height: 10px;
}

.home-focus-latest {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.home-focus-hero-compact .home-focus-latest {
  margin-top: 0;
}

.home-focus-actions {
  margin-top: auto;
  padding-top: 24px;
}

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

.home-focus-metric {
  min-height: 148px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-focus-metric-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

.home-recommend-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.home-recommend-card {
  min-height: 190px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.home-recommend-card-compact {
  min-height: 0;
  padding: 16px 18px;
  border-radius: 18px;
}

.home-recommend-card.is-primary {
  background: var(--surface);
}

.home-recommend-card:hover,
.home-shortcut-row:hover,
.home-recent-row:hover {
  border-color: var(--border);
  box-shadow: none;
}

.home-recommend-card-title,
.home-shortcut-title {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
}

.home-recommend-card-name {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text);
}

.home-recommend-card-desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-light);
}

.home-recommend-card-actions {
  margin-top: auto;
  padding-top: 20px;
}

.home-recommend-card-compact .home-recommend-card-actions {
  padding-top: 12px;
}

.home-recommend-links {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148,163,184,0.16);
}

.home-inline-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.home-inline-link {
  font-size: 13px;
}

.audio-trainer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.audio-trainer-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

@media (max-width: 900px) {
  .audio-trainer-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .audio-trainer-main-card {
    padding: 18px !important;
  }

  .audio-trainer-text-wrap {
    min-height: 180px !important;
    padding: 20px !important;
  }

  .audio-trainer-text {
    font-size: 20px !important;
    line-height: 1.5 !important;
  }
}

.home-recent-link {
  font-size: 13px;
}

.home-recent-list {
  margin-top: 10px;
}

.home-recent-row {
  min-height: 84px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.home-recent-row:last-child {
  margin-bottom: 0;
}

.home-recent-card .prog-attempt-row {
  border-bottom: none;
}

.home-recent-card .prog-attempt-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 17px;
}

.home-recent-card .prog-attempt-name {
  font-size: 15px;
}

.home-recent-card .prog-attempt-meta {
  margin-top: 5px;
  font-size: 12px;
}

.home-recent-card .prog-score-big {
  font-size: 24px;
}

.home-shortcut-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.home-shortcut-row {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.home-shortcut-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.home-shortcut-main > div:last-child {
  min-width: 0;
}

.home-shortcut-arrow {
  font-size: 18px;
  color: var(--text-light);
  flex-shrink: 0;
}

.home-shortcuts-card {
  position: sticky;
  top: 24px;
}

@media (max-width: 1180px) {
  .home-dashboard-shell {
    width: 100%;
  }
  .home-zone {
    padding: 14px;
    border-radius: 26px;
  }
  .home-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-focus-grid,
  .home-lower-grid,
  .home-focus-body {
    grid-template-columns: 1fr;
  }
  .home-focus-hero {
    min-height: 0;
  }
  .home-shortcuts-card {
    position: static;
    top: auto;
  }
  .home-directory-grid-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-directory-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-directory-grid-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Info label strip ──────────────────────────────────────────────────── */
.prog-info-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-light);
}

.prog-info-strip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .prog-grid-2 {
    grid-template-columns: 1fr;
  }
  .prog-header {
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
  }
  .prog-header-actions {
    padding-top: 0;
  }
  .prog-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-dashboard-shell {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }
  .home-zone {
    padding: 12px;
  }
  .home-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-focus-grid,
  .home-lower-grid {
    grid-template-columns: 1fr;
  }
  .home-focus-body {
    grid-template-columns: 1fr;
  }
  .home-directory-section-heading h2 {
    font-size: 28px;
  }
  .home-directory-grid-primary,
  .home-directory-grid-secondary,
  .home-directory-grid-tools {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .prog-title { font-size: 22px; }
  .prog-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .prog-stat-value { font-size: 24px; }
  .home-dashboard-shell {
    padding-left: 16px;
    padding-right: 16px;
  }
  .home-zone {
    padding: 0;
    border: none;
    background: transparent;
  }
  .home-dashboard-header {
    align-items: flex-start;
  }
  .home-dashboard-header .lang-toggle {
    width: 100%;
    justify-content: center;
  }
  .home-directory-actions {
    flex-direction: column;
  }
  .home-directory-card,
  .home-directory-card-primary,
  .home-directory-card-secondary,
  .home-directory-card-tool {
    min-height: 0;
    padding: 20px;
    border-radius: 22px;
  }
  .home-directory-card h3 {
    font-size: 24px;
  }
  .home-directory-card-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  .home-overview-grid,
  .home-focus-metrics-grid {
    grid-template-columns: 1fr;
  }
  .home-overview-card,
  .home-focus-metric,
  .home-recommend-card,
  .home-focus-hero {
    min-height: 0;
  }
}
.speaking-feedback-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.speaking-feedback-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.6;
}

.speaking-example-fix {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.6;
}

.transcript-chip-correct {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.transcript-chip-mismatched {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.transcript-chip-extra {
  background: #fefce8;
  border-color: #fde68a;
  color: #a16207;
}

.transcript-chip-missing {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.speaking-issue-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.speaking-result-hero {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.speaking-result-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.score-shell {
  margin-top: 8px;
}

.score-shell-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px 18px 18px;
  border-radius: 22px 22px 18px 18px;
  background:
    radial-gradient(circle at top right, rgba(91,140,255,0.28), transparent 38%),
    linear-gradient(180deg, #1e2d4f 0%, #16233e 100%);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.score-shell-hero::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
}

.score-shell-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.score-shell-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.88);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-shell-title {
  margin-top: 10px;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
}

.score-shell-subtitle {
  margin-top: 5px;
  max-width: 420px;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  line-height: 1.45;
}

.score-shell-tone {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--tone-bg, rgba(255,255,255,0.16));
  color: var(--tone-color, #5b8cff);
  font-size: 12px;
  font-weight: 700;
}

.score-shell-excerpt {
  margin-top: 12px;
  max-width: 290px;
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 500;
}

.score-shell-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.score-shell-audio-player {
  flex: 1;
  min-width: 0;
  margin: 0;
  filter: saturate(0.9) brightness(1.05);
}

.score-shell-audio-duration {
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.score-shell-ring {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #16233e 76%, transparent 77% 100%),
    conic-gradient(var(--score-accent, #5b8cff) var(--score-pct, 0%), rgba(255,255,255,0.12) 0);
  display: grid;
  place-items: center;
}

.score-shell-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}

.score-shell-ring-inner {
  text-align: center;
  color: #fff;
}

.score-shell-ring-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.score-shell-ring-value span {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.72;
  margin-left: 2px;
}

.score-shell-ring-label {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.66);
}

.speaking-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.speaking-result-card {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  animation: speakingCardIn 320ms ease both;
}

.speaking-breakdown-card .score-bar-row:last-child {
  margin-bottom: 0;
}

.score-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 0;
}

.score-metric-card {
  min-height: 118px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.score-metric-card.blue {
  background: #edf3ff;
  border-color: #d8e6ff;
}

.score-metric-card.green {
  background: #eefbf4;
  border-color: #d2f6df;
}

.score-metric-card.orange {
  background: #fff5ea;
  border-color: #ffe3bf;
}

.score-metric-card.purple {
  background: #f5efff;
  border-color: #e5d9ff;
}

.score-metric-icon {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.68);
  font-size: 13px;
  font-weight: 700;
  color: #4f6ef7;
}

.score-metric-card.green .score-metric-icon { color: #22a76a; }
.score-metric-card.orange .score-metric-icon { color: #f08a24; }
.score-metric-card.purple .score-metric-icon { color: #885cf6; }

.score-metric-name {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #24324b;
}

.score-metric-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: #1d2a40;
}

.score-metric-value span {
  font-size: 12px;
  font-weight: 700;
  color: #6b7a90;
  margin-left: 2px;
}

.score-metric-desc {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: #6b7a90;
}

.speaking-feedback-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin-top: 6px;
}

.speaking-feedback-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.speaking-feedback-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin: 0 0 8px;
}

.speaking-feedback-columns > div {
  padding: 12px;
  border-radius: 14px;
  background: #fafcff;
  border: 1px solid #e9eff7;
}

.speaking-feedback-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.speaking-feedback-block {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e8edf5;
  background: #fff;
}

.speaking-feedback-block.green {
  border-color: #d8f1df;
  background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
}

.speaking-feedback-block.orange {
  border-color: #fde0bf;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
}

.speaking-feedback-block.blue {
  border-color: #dce7ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.speaking-feedback-block.lavender {
  border-color: #e7e2ff;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
}

.speaking-feedback-block-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  background: #f4f7fb;
  color: #4f6ef7;
}

.speaking-feedback-block.green .speaking-feedback-block-icon {
  background: #ecfbf1;
  color: #32a766;
}

.speaking-feedback-block.orange .speaking-feedback-block-icon {
  background: #fff4e8;
  color: #f08a24;
}

.speaking-feedback-block.lavender .speaking-feedback-block-icon {
  background: #eef1ff;
  color: #6f77ff;
}

.speaking-feedback-block-title {
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
  margin-bottom: 4px;
  color: #24324b;
}

.speaking-feedback-block-text {
  font-size: 13px;
  line-height: 1.55;
  color: #51627a;
}

.speaking-saved-card {
  background: var(--surface);
}

.speaking-saved-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.speaking-saved-copy {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

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

.speaking-saved-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 12px;
  color: var(--text);
}

.speaking-saved-summary {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.speaking-saved-player {
  margin-top: 10px;
}

.speaking-inline-recording {
  margin-top: 10px;
}

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

.speaking-history-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.speaking-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-light);
}

.speaking-history-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
}


.word-review-card {
  padding-bottom: 12px;
}

.word-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.word-review-summary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-light);
}

.word-review-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.word-review-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
}

.word-review-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.word-review-dot.missing { background: #ef4444; }
.word-review-dot.mismatched { background: #f59e0b; }
.word-review-dot.extra { background: #d4a317; }

.word-review-block + .word-review-block {
  margin-top: 10px;
}

.word-review-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 6px;
}

.word-review-line {
  padding: 10px;
  border-radius: 12px;
  background: #fcfdff;
  border: 1px solid #e6edf5;
  line-height: 1.75;
}

.word-review-line.transcript {
  background: #f8fafc;
}

.word-review-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  margin: 0 4px 4px 0;
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
  background: transparent;
}

.word-review-chip.missing {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.word-review-chip.mismatched {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.word-review-chip.extra {
  background: #fefce8;
  border-color: #fde68a;
  color: #a16207;
}

.word-review-extra-row {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdf2;
  border: 1px solid #fef3c7;
  font-size: 12px;
  color: #8a5b00;
}

.word-review-empty {
  font-size: 12px;
  color: var(--text-light);
}

.speaking-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@keyframes speakingCardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .score-shell-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 14px;
    gap: 10px;
  }

  .score-shell-title {
    font-size: 16px;
  }

  .score-shell-excerpt {
    margin-top: 10px;
    max-width: none;
    font-size: 11.5px;
    line-height: 1.5;
  }

  .score-shell-audio {
    margin-top: 10px;
    padding: 8px 10px;
    gap: 8px;
  }

  .score-shell-ring {
    width: 96px;
    height: 96px;
    justify-self: end;
  }

  .score-shell-ring-value {
    font-size: 26px;
  }

  .score-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .score-metric-card {
    min-height: 102px;
    padding: 10px;
    border-radius: 14px;
  }

  .score-metric-name {
    font-size: 10.5px;
  }

  .score-metric-value {
    font-size: 18px;
  }

  .score-metric-value span {
    font-size: 11px;
  }

  .score-metric-desc {
    font-size: 10px;
    line-height: 1.35;
  }

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

  .speaking-feedback-block {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .speaking-feedback-block-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 15px;
  }

  .speaking-feedback-block-title {
    font-size: 11px;
  }

  .speaking-feedback-block-text {
    font-size: 12px;
    line-height: 1.45;
  }

  .word-review-header {
    flex-direction: column;
  }

  .word-review-legend {
    justify-content: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Global Responsive Overrides
   Mobile-first normalization for all pages
   Breakpoints:
   mobile  < 640px
   tablet  640px - 1023px
   desktop >= 1024px
   ═══════════════════════════════════════════════════════════════════════════ */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  text-wrap: pretty;
}

#app,
#main,
#page-container,
.page-layout,
.page-layout-wide,
.page-layout-focus,
.page-layout-dashboard,
.practice-page,
.progress-page,
.landing-page,
.home-dashboard-shell {
  min-width: 0;
  max-width: 100%;
}

#main,
#page-container,
.card,
.stat-card,
.module-card,
.prog-card,
.practice-task-card,
.home-overview-card,
.home-focus-panel,
.home-recommend-panel,
.home-recent-card,
.home-shortcuts-card,
.module-overview-card,
.settings-card,
.skill-card,
.status-card,
.speaking-audio-panel,
.speaking-result-card,
.speaking-score-main,
.speaking-subscore,
.speaking-feedback-card,
.prog-auth-gate,
.auth-modal,
.wm-player,
.wm-list-item {
  min-width: 0;
}

h1, h2, h3, h4, h5, h6,
p,
span,
div,
button,
a,
label,
strong,
td,
th,
.q-text,
.q-title,
.q-instruction,
.transcript-box,
.practice-task-name,
.practice-task-count,
.module-title,
.module-desc,
.prog-attempt-name,
.prog-empty-desc,
.home-recommend-card-name,
.home-recommend-card-desc,
.home-shortcut-title,
.home-shortcut-desc,
.word-review-line,
.speaking-feedback-summary,
.speaking-saved-summary {
  overflow-wrap: anywhere;
  word-break: break-word;
}

img,
svg,
canvas,
video,
audio,
iframe {
  max-width: 100%;
}

button,
.btn,
.nav-item,
.nav-group-toggle,
.tab,
.bottom-tab {
  touch-action: manipulation;
}

.btn,
.btn-group,
.result-actions,
.continue-actions,
.module-actions,
.speaking-result-actions,
.speaking-audio-panel-actions,
.speaking-audio-submit-row,
.prog-header-actions,
.prog-auth-gate-actions,
.home-focus-actions,
.home-inline-links,
.prediction-filter-bar,
.recorder-actions {
  flex-wrap: wrap;
}

.btn {
  white-space: normal;
  text-align: center;
  justify-content: center;
}

.btn-group > .btn,
.result-actions > .btn,
.prediction-filter-bar > .btn,
.speaking-result-actions > .btn,
.recorder-actions > .btn,
.prog-header-actions > .btn {
  min-width: 0;
}

.audio-widget,
.question-nav,
.dashboard-header,
.section-head,
.prog-card-header,
.speaking-result-top,
.speaking-saved-head,
.word-review-header,
.wm-now-playing,
.wm-controls,
.wm-progress-row,
.auth-user-chip,
.home-dashboard-header,
.home-shortcut-row,
.home-recent-row,
.prog-attempt-row,
.prog-focus-row,
.speaking-audio-preview-head {
  min-width: 0;
}

.audio-progress,
.module-meta,
.prog-attempt-left,
.home-shortcut-main,
.home-focus-body,
.home-focus-hero,
.speaking-result-tools {
  min-width: 0;
}

.audio-widget,
.speaking-result-tools,
.wm-controls,
.wm-main-controls,
.wm-speed-btns,
.home-inline-links,
.prediction-filter-bar {
  gap: 10px;
}

.question-nav,
.dashboard-header,
.section-head,
.prog-card-header,
.speaking-result-top,
.speaking-saved-head,
.wm-now-playing,
.wm-controls,
.wm-progress-row,
.home-dashboard-header,
.prog-header {
  align-items: flex-start;
}

.result-audio-player,
.result-audio-empty,
.auth-input,
.textarea,
.input,
select.input,
textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  max-width: 100%;
}

.mt-table {
  table-layout: fixed;
}

.wm-text-box,
.transcript-box,
.q-text,
.word-review-line {
  overflow-x: hidden;
}

@media (min-width: 640px) and (max-width: 1023px) {
  :root {
    --page-inline-pad: 20px;
  }

  #main {
    padding: 24px 18px 32px;
  }

  #page-container.page-layout,
  #page-container.page-layout-focus,
  #page-container.page-layout-dashboard,
  #page-container.page-layout-wide {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--page-inline-pad) 36px;
  }

  .grid-4,
  .prog-stats-grid,
  .home-overview-grid,
  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3,
  .module-grid,
  .practice-tasks-grid,
  .settings-grid,
  .home-focus-metrics-grid,
  .speaking-feedback-grid,
  .speaking-feedback-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .hero-grid,
  .home-focus-grid,
  .home-lower-grid,
  .home-focus-body,
  .prog-grid-2,
  .speaking-score-grid {
    grid-template-columns: 1fr;
  }

  .module-card,
  .practice-task-card,
  .home-overview-card,
  .home-focus-metric,
  .prog-stat-card {
    min-height: 0;
  }

  .module-head,
  .practice-task-card,
  .prog-attempt-row,
  .home-shortcut-row,
  .home-recent-row {
    align-items: flex-start;
  }
}

@media (max-width: 639px) {
  :root {
    --page-inline-pad: 14px;
    --page-max-wide: 100%;
    --page-max-focus: 100%;
  }

  body {
    font-size: 14px;
  }

  #app {
    min-height: 100dvh;
  }

  #sidebar {
    width: min(82vw, 296px) !important;
    min-width: min(82vw, 296px) !important;
    max-width: calc(100vw - 24px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
  }

  #mobile-header {
    height: 56px;
    padding: 0 12px;
  }

  #theme-toggle-mobile {
    display: none !important;
  }

  #main {
    width: 100% !important;
    padding: calc(56px + 10px) var(--page-inline-pad) calc(64px + env(safe-area-inset-bottom, 0px) + 10px) !important;
    overflow-x: hidden;
  }

  #page-container.page-layout,
  #page-container.page-layout-focus,
  #page-container.page-layout-dashboard,
  #page-container.page-layout-wide {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 0 24px;
  }

  #page-container {
    gap: 14px;
  }

  .page-header {
    margin-bottom: 14px !important;
  }

  .page-header h1,
  .prog-title {
    font-size: 20px !important;
    line-height: 1.2;
    letter-spacing: -0.3px;
  }

  .home-dashboard-header {
    display: none !important;
  }

  .home-progress-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 14px;
  }
  .home-progress-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .home-progress-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
  }
  .home-progress-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .home-progress-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
  }

  .page-header p,
  .prog-subtitle,
  .section-subtitle,
  .home-overview-label,
  .home-shortcut-desc,
  .home-recommend-card-desc,
  .module-desc,
  .prog-empty-desc,
  .speaking-feedback-summary,
  .speaking-saved-copy,
  .speaking-saved-summary,
  .word-review-summary {
    font-size: 12px !important;
    line-height: 1.6;
  }

  .page-header > p,
  .module-desc,
  .practice-task-count,
  .home-shortcut-desc,
  .home-recommend-card-desc {
    display: block !important;
  }

  .home-dashboard-header p {
    display: none !important;
  }

  .home-lang-desktop {
    display: none !important;
  }

  .home-mobile-primary-action {
    display: block;
    margin-bottom: 8px;
  }

  .home-mobile-primary-action .btn {
    width: 100%;
    min-height: 42px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
  }

  .section-title,
  .card-title,
  .home-recommend-card-name,
  .home-focus-copy,
  .status-title {
    font-size: 16px !important;
    line-height: 1.35;
  }

  .home-focus-progress,
  .prog-stat-value,
  .stats-bar-value,
  .speaking-score-value,
  .score-panel .score-big,
  .stat-card .stat-value {
    font-size: 26px !important;
    letter-spacing: -0.8px;
  }

  .card,
  .prog-card,
  .home-focus-panel,
  .home-recommend-panel,
  .home-recent-card,
  .home-shortcuts-card,
  .status-card,
  .speaking-audio-panel,
  .speaking-result-card,
  .module-overview-card,
  .prog-auth-gate,
  .auth-modal,
  .wm-player,
  .settings-card {
    padding: 16px !important;
    border-radius: 16px;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .prog-grid-2,
  .hero-grid,
  .stats-bar,
  .home-overview-grid,
  .home-focus-grid,
  .home-lower-grid,
  .home-focus-body,
  .speaking-score-grid,
  .speaking-feedback-grid,
  .speaking-feedback-columns {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .module-grid,
  .practice-tasks-grid,
  .settings-grid,
  .prog-stats-grid,
  .home-focus-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .home-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .stats-bar-item,
  .home-overview-card,
  .prog-stat-card,
  .module-card,
  .practice-task-card,
  .home-focus-metric {
    padding: 14px !important;
    min-height: 0 !important;
  }

  .home-overview-card {
    padding: 8px !important;
    border-radius: 12px;
    gap: 4px;
    aspect-ratio: 1 / 1;
    height: auto !important;
    min-height: unset !important;
    justify-content: flex-start;
  }

  .home-overview-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 12px;
  }

  .home-overview-label {
    font-size: 9.5px !important;
    line-height: 1.15;
  }

  .home-overview-value {
    font-size: 20px !important;
    line-height: 1;
  }

  .stats-bar-item + .stats-bar-item {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .module-card,
  .practice-task-card,
  .prog-attempt-row,
  .home-shortcut-row,
  .home-recent-row,
  .module-head,
  .question-nav,
  .audio-widget,
  .dashboard-header,
  .section-head,
  .prog-card-header,
  .speaking-result-top,
  .speaking-saved-head,
  .word-review-header,
  .wm-now-playing,
  .wm-controls,
  .wm-progress-row,
  .prog-header,
  .home-dashboard-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .practice-task-left,
  .home-shortcut-main,
  .prog-attempt-left,
  .module-head,
  .wm-now-playing {
    width: 100%;
  }

  .practice-task-score,
  .prog-attempt-score,
  .home-shortcut-arrow {
    text-align: left !important;
  }

  .prog-attempt-row,
  .home-recent-row {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 8px 0 !important;
  }

  .home-recent-row {
    min-height: 0 !important;
    padding: 12px 14px !important;
  }

  .prog-attempt-left {
    width: auto !important;
    flex: 1;
    min-width: 0;
  }

  .prog-attempt-score {
    flex-shrink: 0;
    text-align: right !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 42px;
  }

  .prog-score-big {
    font-size: 16px !important;
    line-height: 1;
  }

  .prog-score-denom {
    margin-top: 2px;
    font-size: 10px !important;
    line-height: 1;
  }

  .module-actions,
  .result-actions,
  .prediction-filter-bar,
  .prog-header-actions,
  .prog-auth-gate-actions,
  .speaking-result-actions,
  .recorder-actions,
  .continue-actions,
  .home-focus-actions,
  .home-inline-links,
  .speaking-audio-panel-actions,
  .speaking-audio-submit-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .module-actions .btn,
  .result-actions .btn,
  .prediction-filter-bar .btn,
  .prog-header-actions .btn,
  .prog-auth-gate-actions .btn,
  .speaking-result-actions .btn,
  .recorder-actions .btn,
  .continue-actions .btn,
  .home-focus-actions .btn,
  .speaking-audio-panel-actions .btn,
  .speaking-audio-submit-row .btn {
    width: 100%;
  }

  .btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .btn-group > .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .btn-group > .btn:only-child,
  .btn-group > .btn:nth-child(3):last-child {
    flex-basis: 100%;
  }

  .q-number,
  .audio-label,
  .record-status,
  .speaking-score-label,
  .speaking-subscore-label,
  .stat-label,
  .prog-card-meta,
  .prog-stat-label,
  .prog-stat-sub {
    font-size: 11px !important;
  }

  .q-title,
  .q-text {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  .q-instruction,
  .transcript-box,
  .textarea,
  .wm-text-preview,
  .choice,
  .reorder-item,
  .module-desc,
  .practice-task-name,
  .practice-task-count {
    font-size: 13px !important;
  }

  .q-text,
  .transcript-box,
  .textarea,
  .audio-widget,
  .recorder-widget,
  .speaking-audio-preview,
  .word-review-line,
  .wm-text-box {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .timer {
    align-self: flex-start;
    font-size: 12px;
    padding: 5px 10px;
  }

  .record-btn {
    width: 56px;
    height: 56px;
    margin-left: auto;
    margin-right: auto;
  }

  .waveform {
    width: 100%;
    overflow: hidden;
  }

  .audio-btn {
    width: 42px;
    height: 42px;
  }

  .result-audio-player,
  .result-audio-empty,
  .speaking-audio-preview audio {
    width: 100% !important;
    min-width: 0 !important;
  }

  .score-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .stat-card .stat-label,
  .stat-card .stat-sub,
  .prog-stat-label,
  .prog-stat-sub {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .score-bar-label {
    width: auto !important;
    min-width: 0;
  }

  .score-bar-track {
    grid-column: 1 / -1;
  }

  .score-bar-val {
    width: auto;
    min-width: 28px;
  }

  .recorder-widget.result-state,
  .recorder-result-main {
    text-align: center;
  }

  .recorder-result-icon {
    margin: 0 auto;
  }

  .prog-header-pills,
  .speaking-saved-meta,
  .speaking-history-meta,
  .word-review-legend,
  .home-inline-links {
    gap: 6px;
  }

  .mt-table,
  .mt-table thead,
  .mt-table tbody,
  .mt-table tr,
  .mt-table th,
  .mt-table td {
    display: block;
    width: 100%;
  }

  .mt-table thead {
    display: none;
  }

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

  .mt-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
  }

  .mt-table td {
    padding: 4px 0;
    border: none;
    text-align: left !important;
  }

  .reorder-area {
    flex-direction: column;
    gap: 12px;
  }

  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
  }

  .wm-time,
  .prog-pill,
  .badge,
  .nav-mini-badge {
    white-space: nowrap;
  }

  .home-dashboard-shell,
  .home-zone {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .home-zone + .home-zone,
  .dashboard-section,
  .card + .card {
    margin-top: 12px;
  }

  .home-zone + .home-zone {
    margin-top: 6px;
  }

  .home-directory-section {
    margin-top: 10px;
  }

  .home-directory-section-heading {
    margin-bottom: 8px;
  }

  .home-directory-section-heading h2 {
    font-size: 15px !important;
    line-height: 1.2;
    margin-top: 2px;
  }

  .home-directory-section-heading p {
    display: none;
  }

  .home-directory-grid-primary,
  .home-directory-grid-secondary,
  .home-directory-grid-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .home-directory-card,
  .home-directory-card-primary,
  .home-directory-card-secondary,
  .home-directory-card-tool {
    aspect-ratio: unset !important;
    min-height: 0 !important;
    padding: 14px !important;
    border-radius: 18px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
  }

  /* Skill tone color accents */
  .home-directory-card.speaking,
  .home-directory-card-primary.speaking {
    background: #eaf2fb !important;
    border-color: #c9def5 !important;
  }
  .home-directory-card.writing,
  .home-directory-card-primary.writing {
    background: #f6efe7 !important;
    border-color: #eadfd2 !important;
  }
  .home-directory-card.reading,
  .home-directory-card-primary.reading {
    background: #f8f3ea !important;
    border-color: #efe3d3 !important;
  }
  .home-directory-card.listening,
  .home-directory-card-primary.listening {
    background: #eef2f6 !important;
    border-color: #d6dee8 !important;
  }

  .home-directory-card-top,
  .home-directory-card-primary .home-directory-card-top,
  .home-directory-card-secondary .home-directory-card-top {
    gap: 10px !important;
    align-items: center !important;
  }

  .home-directory-card-icon,
  .home-directory-card-primary .home-directory-card-icon,
  .home-directory-card-secondary .home-directory-card-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    font-size: 18px !important;
    flex-shrink: 0;
  }

  .home-directory-card.speaking .home-directory-card-icon { background: #d0e6f7 !important; box-shadow: none !important; }
  .home-directory-card.writing .home-directory-card-icon { background: #ead5c0 !important; box-shadow: none !important; }
  .home-directory-card.reading .home-directory-card-icon { background: #e8d9c2 !important; box-shadow: none !important; }
  .home-directory-card.listening .home-directory-card-icon { background: #c9d4e0 !important; box-shadow: none !important; }

  .home-directory-card h3,
  .home-directory-card-primary h3,
  .home-directory-card-secondary h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
  }

  .home-directory-card-mini-desc {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.5;
    letter-spacing: 0.02em;
  }

  .home-directory-card-stat,
  .home-directory-card-primary .home-directory-card-stat,
  .home-directory-card-secondary .home-directory-card-stat {
    display: inline-block !important;
    margin-top: 6px;
    font-size: 10px !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
  }

  .home-directory-card p,
  .home-directory-card-primary p,
  .home-directory-card-secondary p {
    display: none;
  }

  /* Arrow indicator bottom-right */
  .home-directory-card::after {
    content: '›';
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 20px;
    line-height: 1;
    opacity: 0.25;
    font-weight: 700;
  }

  .home-zone-overview {
    display: block;
    margin-bottom: 0;
  }

  .home-focus-panel,
  .home-recommend-panel,
  .home-recent-card,
  .home-shortcuts-card {
    padding: 10px !important;
  }

  .home-focus-panel .prog-card-header,
  .home-recommend-panel .prog-card-header,
  .home-recent-card .prog-card-header,
  .home-shortcuts-card .prog-card-header {
    margin-bottom: 6px;
  }

  .home-focus-panel .prog-card-meta,
  .home-recommend-panel .prog-card-meta {
    display: none;
  }

  .home-focus-panel .prog-card-title,
  .home-recommend-panel .prog-card-title {
    font-size: 13px !important;
  }

  .home-focus-hero {
    padding: 14px !important;
    border-radius: 16px;
    min-height: 0;
    gap: 8px;
  }

  .home-focus-kicker {
    display: none;
  }

  .home-focus-progress {
    font-size: 28px !important;
    margin: 0;
  }

  .home-focus-progress span {
    font-size: 13px;
  }

  .home-focus-copy {
    display: none;
  }

  .home-focus-latest {
    display: none;
  }

  .home-focus-actions {
    display: none;
  }

  .home-focus-metrics-grid {
    display: none !important;
  }

  .home-goal-progress {
    margin-top: 0;
    height: 7px;
  }

  .home-recommend-stack {
    margin-top: 0;
    gap: 8px;
  }

  .home-shortcut-list {
    gap: 8px;
    margin-top: 8px;
  }

  .home-shortcut-row {
    min-height: 0 !important;
    padding: 12px !important;
    gap: 12px !important;
  }

  .home-shortcut-main {
    gap: 10px !important;
  }

  .home-shortcut-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  .home-shortcut-title {
    font-size: 12.5px !important;
    margin-top: 0;
  }

  .home-shortcut-desc {
    font-size: 10.5px !important;
    line-height: 1.35;
  }

  .home-shortcut-arrow {
    display: none !important;
  }

  .home-recommend-card {
    min-height: 0;
    padding: 12px !important;
    border-radius: 16px;
  }

  .home-recommend-card-title {
    display: none !important;
  }

  .home-recommend-card-name {
    margin-top: 0;
    font-size: 16px !important;
    line-height: 1.3;
  }

  .home-recommend-card-desc,
  .home-recommend-links,
  .home-recommend-card:not(.is-primary) {
    display: none !important;
  }

  .home-recommend-card-actions {
    padding-top: 8px;
    margin-top: 0;
  }

  .home-recommend-card-actions .btn {
    min-height: 36px;
    font-size: 12.5px;
    width: 100%;
  }

  .question-card-start-btn {
    display: none !important;
  }

  .toast {
    left: 14px;
    right: 14px !important;
    width: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE NEW UI  —  applied inside #page-container on 640px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── shared reset so new mobile sections bleed edge-to-edge ── */
  /* #main has padding-top:68px; header is 52px tall → pull up only the 16px gap */
  .mob-page { margin: -16px -14px 0; overflow-x: hidden; }

  /* ── Hero ──────────────────────────────────────────────────── */
  .mob-hero {
    background: linear-gradient(145deg, #0f1d36 0%, #1e3560 100%);
    padding: 24px 20px 32px;
    position: relative; overflow: hidden;
  }
  .mob-hero-deco {
    position: absolute; border-radius: 9999px;
    background: rgba(59,130,246,.12); pointer-events: none;
  }
  .mob-hero-deco-1 { width: 200px; height: 200px; right: -60px; top: -60px; }
  .mob-hero-deco-2 { width: 120px; height: 120px; right: 40px; bottom: -40px; background: rgba(59,130,246,.07); }
  .mob-hero-greeting { color: rgba(255,255,255,.6); font-size: 13px; font-weight: 500; margin-bottom: 4px; position: relative; z-index: 1; }
  .mob-hero-title { color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 20px; position: relative; z-index: 1; line-height: 1.2; }
  .mob-hero-title span { color: #93c5fd; }

  /* ── Stat pills row ─────────────────────────────────────────── */
  .mob-stats-row { display: flex; gap: 10px; position: relative; z-index: 1; }
  .mob-stat-pill {
    flex: 1; background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .mob-stat-val { color: #fff; font-size: 20px; font-weight: 800; line-height: 1; }
  .mob-stat-val.accent { color: #93c5fd; }
  .mob-stat-label { color: rgba(255,255,255,.55); font-size: 11px; font-weight: 500; }

  /* ── Task strip ─────────────────────────────────────────────── */
  .mob-task-strip {
    margin: -1px 16px 0;
    background: var(--surface, #fff);
    border-radius: 22px; padding: 16px 18px;
    box-shadow: 0 4px 16px rgba(15,29,54,.09);
    display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 10;
    border: 1px solid rgba(15,29,54,0.07);
  }
  .mob-task-left { display: flex; flex-direction: column; gap: 3px; }
  .mob-task-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
  .mob-task-name { font-size: 15px; font-weight: 700; color: #0f1d36; }
  .mob-task-sub { font-size: 12px; color: #64748b; margin-top: 1px; }
  .mob-task-btn {
    background: #3b82f6; color: #fff;
    border: none; border-radius: 9999px;
    padding: 10px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(59,130,246,.35);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Page content wrapper ───────────────────────────────────── */
  .mob-content { padding: 24px 16px calc(80px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 24px; }
  .mob-section-label {
    font-size: 13px; font-weight: 700; color: #0f1d36;
    margin-bottom: 12px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .mob-section-label a { font-size: 12px; font-weight: 500; color: #3b82f6; text-decoration: none; }

  /* ── Skill cards 2×2 grid ───────────────────────────────────── */
  .mob-skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mob-skill-card {
    background: #fff; border: 1px solid rgba(15,29,54,0.07);
    border-radius: 18px; padding: 16px 14px 14px;
    display: flex; flex-direction: column; gap: 8px;
    box-shadow: 0 1px 3px rgba(15,29,54,.06);
    cursor: pointer; position: relative; overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-skill-card:active { transform: scale(.98); }
  .mob-skill-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
  .mob-skill-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
  }
  .mob-skill-name { font-size: 14px; font-weight: 700; color: #0f1d36; }
  .mob-skill-count { font-size: 11px; color: #64748b; }
  .mob-skill-tags { font-size: 10px; color: #c0c9d8; font-weight: 500; line-height: 1.4; margin-top: 2px; }
  .mob-skill-arrow { position: absolute; right: 12px; bottom: 14px; color: #c0c9d8; font-size: 14px; }

  /* ── Quick access 2×2 grid ──────────────────────────────────── */
  .mob-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mob-quick-card {
    background: #fff; border: 1px solid rgba(15,29,54,0.07);
    border-radius: 18px; padding: 14px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 1px 3px rgba(15,29,54,.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-quick-card:active { transform: scale(.98); }
  .mob-quick-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .mob-quick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .mob-quick-name { font-size: 13px; font-weight: 600; color: #0f1d36; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-quick-sub { font-size: 11px; color: #64748b; }

  /* ── Practice hero banner ───────────────────────────────────── */
  .mob-practice-hero {
    background: #0f1d36;
    padding: 20px 20px 0;
    display: flex; flex-direction: column; gap: 16px;
  }
  .mob-practice-title { color: #fff; font-size: 22px; font-weight: 800; }
  .mob-skill-tabs {
    display: flex; gap: 8px;
    background: #0f1d36; padding: 12px 16px 16px;
  }
  .mob-skill-tab {
    flex: 1; padding: 9px 4px; border-radius: 14px; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.08); transition: all .2s;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-skill-tab svg { width: 18px; height: 18px; }
  .mob-skill-tab.active {
    color: #fff; background: rgba(59,130,246,.35);
    border: 1px solid rgba(59,130,246,.45);
  }
  .mob-qtype-card {
    background: #fff; border: 1px solid rgba(15,29,54,0.07);
    border-radius: 18px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,29,54,.06);
    cursor: pointer; display: flex; align-items: stretch;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-qtype-card:active { transform: scale(.99); }
  .mob-qtype-bar { width: 4px; flex-shrink: 0; }
  .mob-qtype-body { flex: 1; padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 14px; }
  .mob-qtype-icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .mob-qtype-name { font-size: 14px; font-weight: 700; color: #0f1d36; margin-bottom: 2px; }
  .mob-qtype-count { font-size: 12px; color: #64748b; }
  .mob-qtype-arrow { color: #c0c9d8; font-size: 20px; margin-left: auto; padding-right: 4px; }

  /* ── Mock test hero banner ──────────────────────────────────── */
  .mob-mock-hero {
    background: #0f1d36; padding: 20px 20px 24px;
    display: flex; flex-direction: column; gap: 16px;
  }
  .mob-mock-title { color: #fff; font-size: 22px; font-weight: 800; }
  .mob-mock-sub { color: rgba(255,255,255,.55); font-size: 13px; line-height: 1.5; margin-top: -8px; }
  .mob-score-strip { display: flex; gap: 10px; }
  .mob-score-pill {
    flex: 1; background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 3px;
  }
  .mob-score-pill-label { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .5px; }
  .mob-score-pill-val { font-size: 22px; font-weight: 800; color: #fff; }
  .mob-full-mock-cta {
    width: 100%;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    box-shadow: 0 16px 28px rgba(37,99,235,.24);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-full-mock-cta-title {
    font-size: 16px;
    font-weight: 800;
  }
  .mob-full-mock-cta-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,.8);
  }
  .mob-full-mock-info {
    display: grid;
    gap: 6px;
    margin-top: -8px;
    margin-bottom: 2px;
    padding: 0 2px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
  }
  .mob-exam-card {
    background: rgba(255,255,255,0.92); border: 1px solid rgba(15,29,54,0.06);
    border-radius: 22px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,29,54,.04);
  }
  .mob-exam-header { padding: 14px 16px 12px; display: flex; align-items: flex-start; gap: 12px; }
  .mob-exam-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .mob-exam-title { font-size: 15px; font-weight: 800; color: #0f1d36; margin-bottom: 3px; }
  .mob-exam-subtitle { font-size: 12px; color: #64748b; line-height: 1.4; }
  .mob-exam-divider { height: 1px; background: rgba(15,29,54,0.06); margin: 0 16px; }
  .mob-exam-footer { padding: 10px 16px 14px; display: flex; align-items: center; gap: 10px; }
  .mob-exam-score-label { font-size: 11px; color: #64748b; margin-bottom: 1px; }
  .mob-exam-score-val { font-size: 18px; font-weight: 800; color: #0f1d36; }
  .mob-exam-score-val.none { font-size: 13px; color: #c0c9d8; font-weight: 500; }
  .mob-btn-start {
    background: #0f1d36; color: #fff; font-size: 13px; font-weight: 700;
    padding: 10px 22px; border-radius: 9999px; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 6px; margin-left: auto;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-btn-start:active { transform: scale(.97); }

  /* ── Profile / 我的 ─────────────────────────────────────────── */
  .mob-profile-hero {
    background: linear-gradient(160deg, #0f1d36 0%, #1e3560 100%);
    padding: 28px 20px 36px; position: relative; overflow: hidden;
  }
  .mob-profile-hero::before {
    content: ""; position: absolute; right: -30px; top: -30px;
    width: 160px; height: 160px;
    background: rgba(59,130,246,.12); border-radius: 9999px;
  }
  .mob-user-row { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
  .mob-user-avatar {
    width: 64px; height: 64px; background: #3b82f6;
    border-radius: 9999px; border: 3px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: #fff; flex-shrink: 0;
    overflow: hidden;
  }
  .mob-user-avatar-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-user-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .profile-edit-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
  }
  .profile-avatar-preview {
    width: 72px;
    height: 72px;
    background: #3b82f6;
    border-color: rgba(59,130,246,0.18);
  }
  .profile-upload-btn {
    min-height: 40px;
  }
  .mob-user-name { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 3px; }
  .mob-user-email { color: rgba(255,255,255,.6); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mob-stat-card {
    background: #fff; border-radius: 16px;
    padding: 16px; box-shadow: 0 1px 3px rgba(15,29,54,.06);
    border: 1px solid rgba(15,29,54,0.07);
    display: flex; flex-direction: column; gap: 6px;
  }
  .mob-stat-card-icon { font-size: 22px; }
  .mob-stat-card-val { font-size: 22px; font-weight: 700; color: #0f1d36; line-height: 1; }
  .mob-stat-card-val.accent { color: #3b82f6; }
  .mob-stat-card-label { font-size: 12px; color: #64748b; }
  .mob-settings-card {
    background: #fff; border-radius: 16px;
    overflow: hidden; border: 1px solid rgba(15,29,54,0.07);
    box-shadow: 0 1px 3px rgba(15,29,54,.06);
  }
  .mob-settings-row {
    display: flex; align-items: center; padding: 15px 16px; gap: 12px;
    cursor: pointer; border-bottom: 1px solid rgba(15,29,54,0.06);
    -webkit-tap-highlight-color: transparent;
  }
  .mob-settings-row:last-child { border-bottom: none; }
  .mob-settings-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .mob-settings-label { flex: 1; font-size: 14px; font-weight: 500; color: #0f1d36; }
  .mob-settings-value { font-size: 13px; color: #64748b; margin-right: 4px; }
  .mob-settings-chevron { color: #c0c9d8; font-size: 18px; }
  .mob-logout-btn {
    width: 100%; padding: 15px;
    border: 1.5px solid rgba(239,68,68,.3); background: rgba(239,68,68,.05);
    border-radius: 16px; color: #ef4444;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Skill breakdown card — adapts to dark mode */
  .mob-breakdown-card {
    background: #fff; border-radius: 16px; padding: 18px;
    border: 1px solid rgba(15,29,54,.07);
    box-shadow: 0 1px 3px rgba(15,29,54,.06);
    display: flex; flex-direction: column; gap: 14px;
  }
  body.dark .mob-breakdown-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
  }

  .mob-progress-page {
    background: #eef4ff;
  }

  .mob-progress-hero {
    background:
      radial-gradient(circle at top right, rgba(59,130,246,.16), transparent 32%),
      linear-gradient(180deg, #0f1d36 0%, #13274a 100%);
    padding: 14px 14px 16px;
  }

  .mob-progress-title {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
  }

  .mob-progress-subtitle {
    margin-top: 4px;
    color: rgba(255,255,255,.68);
    font-size: 11px;
    line-height: 1.35;
  }

  .mob-progress-hero-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .mob-progress-target-card,
  .mob-progress-avg-card,
  .mob-progress-cheer-card {
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    padding: 11px;
    color: #fff;
    position: relative;
    overflow: hidden;
  }

  .mob-progress-target-card { min-height: 98px; }

  .mob-progress-avg-card {
    min-height: 98px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .mob-progress-cheer-card {
    grid-column: 1 / -1;
    min-height: 60px;
    padding-top: 10px;
    background: linear-gradient(135deg, rgba(29,78,216,.18), rgba(15,29,54,.18));
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mob-progress-hero-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,.62);
    text-transform: uppercase;
    letter-spacing: .06em;
  }

  .mob-progress-target-score {
    margin-top: 4px;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
  }

  .mob-progress-edit-btn {
    margin-top: 6px;
    background: rgba(255,255,255,.12);
    color: #dbeafe;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
  }

  .mob-progress-target-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    overflow: hidden;
  }

  .mob-progress-target-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  }

  .mob-progress-target-copy {
    margin-top: 6px;
    font-size: 10px;
    color: rgba(255,255,255,.72);
  }

  .mob-progress-mini-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background:
      radial-gradient(closest-side, #13274a 74%, transparent 75% 100%),
      conic-gradient(#3b82f6 var(--score-pct, 0%), rgba(255,255,255,.12) 0);
    display: grid;
    place-items: center;
  }

  .mob-progress-mini-ring-inner { text-align: center; }

  .mob-progress-mini-score {
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
  }

  .mob-progress-mini-denom {
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255,255,255,.66);
  }

  .mob-progress-mini-delta {
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.68);
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
  }

  .mob-progress-mini-delta.up {
    background: rgba(34,197,94,.14);
    color: #86efac;
  }

  .mob-progress-cheer-emoji {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
  }

  .mob-progress-cheer-title {
    margin-top: 0;
    font-size: 13px;
    font-weight: 800;
  }

  .mob-progress-cheer-copy {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(255,255,255,.74);
  }

  .mob-progress-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mob-progress-stat-card,
  .mob-progress-section-card {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(15,29,54,.07);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15,29,54,.05);
  }

  .mob-progress-stat-card { padding: 11px; }

  .mob-progress-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #f8fbff;
    font-size: 14px;
  }

  .mob-progress-stat-label {
    margin-top: 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #7a8ba3;
  }

  .mob-progress-stat-value {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    color: #19304f;
  }

  .mob-progress-stat-sub {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.35;
    color: #7a8ba3;
  }

  .mob-progress-section-card { padding: 13px 12px; }

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

  .mob-progress-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #19304f;
  }

  .mob-progress-section-copy {
    margin-top: 2px;
    font-size: 10px;
    color: #7a8ba3;
  }

  .mob-progress-chip {
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf4ff;
    color: #3b82f6;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .mob-progress-chart { position: relative; }

  .mob-progress-chart-svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .mob-progress-chart-score {
    fill: #3b82f6;
    font-size: 10px;
    font-weight: 700;
  }

  .mob-progress-chart-labels {
    position: relative;
    height: 18px;
    margin-top: -6px;
  }

  .mob-progress-chart-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    color: #7a8ba3;
    white-space: nowrap;
  }

  .mob-progress-skill-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mob-progress-skill-card {
    background: var(--skill-bg, #f8fbff);
    border: 1px solid rgba(15,29,54,.05);
    border-radius: 14px;
    padding: 10px;
  }

  .mob-progress-skill-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.72);
    font-size: 14px;
  }

  .mob-progress-skill-name {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #19304f;
  }

  .mob-progress-skill-score {
    margin-top: 3px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    color: #19304f;
  }

  .mob-progress-skill-score span {
    font-size: 10px;
    color: #7a8ba3;
  }

  .mob-progress-skill-meta {
    margin-top: 3px;
    font-size: 10px;
    color: #7a8ba3;
  }

  .mob-progress-skill-bar {
    margin-top: 8px;
    height: 4px;
    border-radius: 999px;
    background: rgba(15,29,54,.08);
    overflow: hidden;
  }

  .mob-progress-skill-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--skill-color, #3b82f6);
  }

  .mob-progress-history-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15,29,54,.08);
  }

  .mob-progress-history-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .mob-progress-history-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #f8fbff;
    font-size: 14px;
  }

  .mob-progress-history-top {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #19304f;
  }

  .mob-progress-history-top span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mob-progress-history-tag {
    flex-shrink: 0;
    min-height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: #edf4ff;
    color: #4f6ef7;
    font-size: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
  }

  .mob-progress-history-meta {
    margin-top: 2px;
    font-size: 10px;
    color: #7a8ba3;
  }

  .mob-progress-history-score {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    text-align: right;
  }

  .mob-progress-history-score span {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    color: #94a3b8;
  }

  /* Hide upload audio on mobile — mic recording is preferred */
  .speaking-upload-btn { display: none !important; }
  .speaking-audio-alt { display: none !important; }
  .speaking-audio-panel { border: none; background: transparent; padding: 0; box-shadow: none; }
  .speaking-audio-panel-head { margin-bottom: 10px; }
  .speaking-audio-panel-head .card-title { font-size: 15px; }
  .speaking-audio-panel-actions { display: none; }
  .speaking-audio-submit-row { margin-top: 8px; }
  .speaking-audio-submit-row .btn { width: 100%; }

  /* dark mode overrides for new mobile UI */
  body.dark .mob-skill-card,
  body.dark .mob-quick-card,
  body.dark .mob-qtype-card,
  body.dark .mob-exam-card,
  body.dark .mob-stat-card,
  body.dark .mob-settings-card,
  body.dark .mob-progress-stat-card,
  body.dark .mob-progress-section-card,
  body.dark .mob-task-strip { background: var(--surface); border-color: var(--border); }
  body.dark .mob-skill-name,
  body.dark .mob-quick-name,
  body.dark .mob-qtype-name,
  body.dark .mob-exam-title,
  body.dark .mob-task-name,
  body.dark .mob-stat-card-val,
  body.dark .mob-settings-label,
  body.dark .mob-progress-stat-value,
  body.dark .mob-progress-section-title,
  body.dark .mob-progress-skill-name,
  body.dark .mob-progress-skill-score,
  body.dark .mob-progress-history-top { color: var(--text); }
}
