@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  --brand:      #7C3AED;
  --brand-dk:   #6D28D9;
  --brand-lt:   #EDE9FE;
  --amber:      #F59E0B;
  --amber-lt:   #FEF3C7;
  --green:      #10B981;
  --green-lt:   #D1FAE5;
  --red:        #EF4444;
  --red-lt:     #FEE2E2;
  --star:       #FBBF24;
  --cyan:       #0891B2;
  --pink:       #DB2777;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-300:   #D1D5DB;
  --gray-400:   #9CA3AF;
  --gray-600:   #4B5563;
  --gray-800:   #1F2937;
  --bg:         #F5F3FF;
  --card:       #FFFFFF;
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 2px 8px rgba(124,58,237,.08);
  --shadow-lg:  0 8px 24px rgba(124,58,237,.14);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nunito', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  box-shadow: 0 2px 12px rgba(109,40,217,.3);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-size: 1.3rem;
  font-weight: 900;
  color: white;
  letter-spacing: -.01em;
}
.nav-brand:hover { text-decoration: none; color: white; }
.nav-links  { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: rgba(255,255,255,.85); font-weight: 700; font-size: .9rem; }
.nav-links a:hover { color: white; text-decoration: none; }
.nav-student {
  background: rgba(255,255,255,.2);
  color: white;
  padding: .25rem .85rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 800;
}

/* ── Flash messages ── */
.flash-container { max-width: 720px; margin: .85rem auto 0; padding: 0 1rem; }
.flash {
  padding: .8rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  font-size: .9rem;
  font-weight: 700;
}
.flash-success { background: var(--green-lt);  color: #065f46; border: 2px solid #6EE7B7; }
.flash-error   { background: var(--red-lt);    color: #991b1b; border: 2px solid #FCA5A5; }
.flash-warning { background: var(--amber-lt);  color: #92400e; border: 2px solid #FCD34D; }

/* ── Main ── */
.main-content { max-width: 1020px; margin: 0 auto; padding: 2rem 1rem 5rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: 99px;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform .12s, box-shadow .12s, background .12s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--brand); color: white; box-shadow: 0 4px 12px rgba(124,58,237,.35); }
.btn-primary:hover { background: var(--brand-dk); text-decoration: none; color: white; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124,58,237,.4); }
.btn-amber    { background: var(--amber); color: white; box-shadow: 0 4px 12px rgba(245,158,11,.35); }
.btn-amber:hover { background: #D97706; text-decoration: none; color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-300); text-decoration: none; }
.btn-disabled { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; box-shadow: none; }
.btn-full { width: 100%; display: flex; }
.btn-sm   { padding: .4rem 1rem; font-size: .82rem; }
.btn-lg   { padding: .9rem 2.2rem; font-size: 1.05rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 800; margin-bottom: .4rem; color: var(--gray-600); }
.label-hint { font-weight: 600; color: var(--gray-400); }
.form-group input,
.form-group select {
  width: 100%;
  padding: .7rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
.form-group-btn { flex: 0 0 auto; }

/* ── Auth ── */
.auth-container { display: flex; justify-content: center; padding-top: 3rem; }
.auth-card {
  background: var(--card);
  border: 2px solid var(--brand-lt);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.7rem; font-weight: 900; margin-bottom: .25rem; }
.auth-sub { color: var(--gray-400); margin-bottom: 2rem; font-size: .9rem; }
.auth-switch { text-align: center; margin-top: 1.3rem; font-size: .875rem; color: var(--gray-600); font-weight: 600; }
.forgot-link { font-size: .8rem; color: var(--brand); font-weight: 700; text-decoration: none; opacity: .8; }
.forgot-link:hover { opacity: 1; }
.reset-dev-box {
  background: #FEF3C7; border: 1.5px solid #F59E0B; border-radius: 12px;
  padding: 1rem; margin-top: 1.25rem; text-align: left; font-size: .85rem;
}

/* ── Parent dashboard ── */
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { font-size: 1.8rem; font-weight: 900; }

.subscription-banner {
  background: var(--amber-lt);
  border: 2px solid #FCD34D;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  font-weight: 700;
  flex-wrap: wrap;
}
.sub-banner-info { flex: 1; min-width: 200px; }
.sub-pricing-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.sub-pricing-pill {
  font-size: .78rem; font-weight: 700; color: #92400e;
  background: rgba(251,191,36,.25); border: 1px solid #FCD34D;
  border-radius: 99px; padding: .2rem .7rem;
}
.annual-pill { color: var(--brand); background: rgba(124,58,237,.08); border-color: #C4B5FD; }

/* Promo code row */
.promo-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(251,191,36,.4);
  flex-wrap: wrap;
}
.promo-label { font-size: .85rem; color: #92400e; font-weight: 700; white-space: nowrap; }
.promo-form  { display: flex; gap: .5rem; align-items: center; }
.promo-input {
  border: 2px solid #FCD34D;
  border-radius: 8px;
  padding: .4rem .75rem;
  font-size: .9rem;
  font-weight: 700;
  width: 160px;
  text-transform: uppercase;
  letter-spacing: .05em;
  outline: none;
  font-family: inherit;
}
.promo-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }

/* Trial active banner */
.trial-active-banner {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #ECFDF5;
  border: 1.5px solid #6EE7B7;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: .9rem;
  font-weight: 700;
  color: #065F46;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.trial-subscribe-nudge { font-weight: 400; color: var(--gray-500); margin-left: .25rem; }
.trial-subscribe-nudge a { color: var(--brand); font-weight: 700; }

/* Plan toggle (Monthly / Annual) */
.plan-toggle {
  display: flex;
  border: 2px solid #FCD34D;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .65rem;
  width: fit-content;
}
.plan-tab {
  background: white;
  border: none;
  cursor: pointer;
  padding: .45rem .9rem;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: #92400e;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  transition: background .15s;
}
.plan-tab:first-child { border-right: 2px solid #FCD34D; }
.plan-tab.active { background: var(--amber); color: white; }
.plan-tab-price { font-size: .72rem; font-weight: 800; opacity: .9; }
.save-badge {
  background: var(--brand);
  color: white;
  border-radius: 99px;
  padding: .05rem .35rem;
  font-size: .65rem;
  font-weight: 800;
}
.badge-active {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--green-lt);
  color: #065f46;
  font-size: .82rem;
  font-weight: 800;
  padding: .3rem .9rem;
  border-radius: 99px;
  margin-top: .5rem;
  border: 2px solid #6EE7B7;
}

.students-section h2,
.add-student-section h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 1rem; }

.student-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.student-card {
  background: var(--card);
  border: 2px solid var(--brand-lt);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.student-avatar {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--brand), #A855F7);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900;
  margin: 0 auto .75rem;
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.student-card h3 { font-size: 1.1rem; font-weight: 900; margin-bottom: .15rem; }
.student-grade { font-size: .8rem; color: var(--gray-400); font-weight: 700; margin-bottom: .9rem; }

.student-metrics { display: flex; justify-content: center; gap: 1rem; margin-bottom: .9rem; }
.metric-pill {
  display: flex; align-items: center; gap: .3rem;
  background: var(--brand-lt);
  color: var(--brand);
  border-radius: 99px;
  padding: .25rem .7rem;
  font-size: .78rem;
  font-weight: 800;
}
.metric-pill.amber { background: var(--amber-lt); color: #92400e; }
.metric-pill.green { background: var(--green-lt); color: #065f46; }

.progress-bar-wrap { background: var(--gray-200); border-radius: 99px; height: 9px; margin-bottom: .4rem; overflow: hidden; }
.progress-bar-fill { background: linear-gradient(90deg, var(--brand), #A855F7); height: 100%; border-radius: 99px; transition: width .5s; }
.progress-label { font-size: .78rem; color: var(--gray-600); font-weight: 700; margin-bottom: .9rem; }
.empty-state { color: var(--gray-400); text-align: center; padding: 2rem; font-weight: 700; }

.add-student-section {
  background: var(--card);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* ── Skill Tree — Journey Map ── */
.skill-tree-header { margin-bottom: 1.75rem; }
.skill-tree-header h1 { font-size: 1.8rem; font-weight: 900; }

.skill-tree-top-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 2px solid var(--brand-lt);
  border-radius: var(--radius);
  padding: .9rem 1.3rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.top-stat { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .95rem; }
.top-stat .label { color: var(--gray-400); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.domain-section { margin-bottom: 2.5rem; }
.domain-title {
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.domain-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  border-radius: 99px;
}

.cluster-world {
  background: var(--card);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
  transition: opacity .2s;
}
.cluster-world.locked-world { opacity: .55; pointer-events: none; }

.cluster-world-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  border-bottom: 2px solid var(--gray-100);
}
.world-letter {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: white;
  flex-shrink: 0;
}
.cluster-world-header h3 { font-size: 1rem; font-weight: 900; margin-bottom: .05rem; }
.cluster-world-header p { font-size: .8rem; color: var(--gray-400); font-weight: 600; }
.cluster-header-right { margin-left: auto; flex-shrink: 0; }

.cluster-complete-badge {
  display: flex; align-items: center; gap: .3rem;
  background: var(--green-lt); color: #065f46;
  border-radius: 99px; padding: .3rem .9rem;
  font-size: .8rem; font-weight: 800;
  border: 2px solid #6EE7B7;
}

/* Skill path nodes */
.skill-path {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.skill-path::-webkit-scrollbar { height: 4px; }
.skill-path::-webkit-scrollbar-track { background: var(--gray-100); }
.skill-path::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

.skill-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  min-width: 80px;
}

.skill-node {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 900;
  position: relative;
  flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
  text-decoration: none;
}
.skill-node.node-active {
  background: var(--amber);
  color: white;
  box-shadow: 0 0 0 4px var(--amber-lt), 0 4px 14px rgba(245,158,11,.4);
  cursor: pointer;
  animation: pulse-ring 2s ease-in-out infinite;
}
.skill-node.node-active:hover { transform: scale(1.08); text-decoration: none; }
.skill-node.node-mastered {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 10px rgba(16,185,129,.3);
  cursor: pointer;
}
.skill-node.node-mastered:hover { transform: scale(1.06); text-decoration: none; }
.skill-node.node-locked {
  background: var(--gray-200);
  color: var(--gray-400);
}
.skill-node.node-quiz {
  background: white;
  border: 3px solid var(--gray-300);
  color: var(--gray-400);
  font-size: 1.4rem;
}
.skill-node.node-quiz.quiz-available {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-lt), 0 4px 14px rgba(124,58,237,.3);
  cursor: pointer;
  animation: pulse-ring-brand 2s ease-in-out infinite;
}
.skill-node.node-quiz.quiz-available:hover { transform: scale(1.08); text-decoration: none; }
.skill-node.node-quiz.quiz-done {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-lt);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 4px var(--amber-lt), 0 4px 14px rgba(245,158,11,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(245,158,11,.15), 0 4px 14px rgba(245,158,11,.4); }
}
@keyframes pulse-ring-brand {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-lt), 0 4px 14px rgba(124,58,237,.3); }
  50%       { box-shadow: 0 0 0 8px rgba(124,58,237,.1), 0 4px 14px rgba(124,58,237,.3); }
}

.skill-code { font-size: .72rem; font-weight: 900; line-height: 1; }
.skill-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--gray-600);
  text-align: center;
  max-width: 75px;
  line-height: 1.2;
}
.skill-stars { display: flex; gap: 1px; }
.skill-stars .star { font-size: .75rem; color: var(--gray-300); }
.skill-stars .star.filled { color: var(--star); }

/* Connector line between nodes */
.path-line {
  height: 4px;
  min-width: 24px;
  flex: 0 0 24px;
  background: var(--gray-200);
  border-radius: 99px;
  margin-bottom: 32px; /* nudge to align with circle center */
  flex-shrink: 0;
}
.path-line.done { background: linear-gradient(90deg, var(--green), #34D399); }

/* Down arrow between clusters */
.cluster-down-arrow {
  text-align: center;
  font-size: 1.3rem;
  color: var(--gray-300);
  margin: -.3rem 0 .3rem;
}

/* ── Practice session ── */
.practice-container { max-width: 680px; margin: 0 auto; position: relative; }
.back-link { font-size: .85rem; color: var(--gray-600); font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1rem; }
.back-link:hover { color: var(--brand); text-decoration: none; }

/* Sticky group: XP/level/streak pills + mastery progress bar travel together
   as one pinned header just under the global navbar. */
.practice-sticky-header {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg, #faf5ff);
  padding: .55rem .25rem .35rem;
  margin: 0 -.25rem 1.25rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  backdrop-filter: blur(6px);
}
.practice-sticky-header .mastery-bar-wrap { margin-bottom: 0; }
.practice-sticky-header .mastery-bar-milestone {
  font-size: .72rem;
  margin-top: .25rem;
}

.practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .55rem;
}
.skill-title-row { display: flex; align-items: center; gap: .6rem; }
.skill-code-badge {
  background: var(--brand);
  color: white;
  font-size: .75rem; font-weight: 900;
  padding: .2rem .65rem;
  border-radius: 8px;
}
.practice-top h1 { font-size: 1.25rem; font-weight: 900; }

.practice-stats-bar { display: flex; gap: .65rem; flex-wrap: wrap; }
.p-stat {
  display: flex; align-items: center; gap: .35rem;
  background: var(--card);
  border: 2px solid var(--gray-200);
  border-radius: 99px;
  padding: .3rem .8rem;
  font-size: .82rem; font-weight: 800;
}
.p-stat .emoji { font-size: .9rem; }
.p-stat-val { color: var(--brand); }
/* ── XP rising bubble ── */
.xp-bubble {
  position: fixed;
  bottom: 120px;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: white;
  font-weight: 900; font-size: 2rem;
  padding: .6rem 1.4rem; border-radius: 99px;
  box-shadow: 0 8px 28px rgba(245,158,11,.55);
  animation: bubble-rise 1.8s cubic-bezier(.22,.68,0,1.2) forwards;
  pointer-events: none; z-index: 1000;
  white-space: nowrap;
}
/* Negative XP penalty — different color so it reads as a deduction not a reward. */
.xp-bubble.xp-bubble-neg {
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  box-shadow: 0 8px 28px rgba(75,85,99,.45);
  font-size: 1.5rem;
}
@keyframes bubble-rise {
  0%   { opacity: 0;   transform: translateY(0)    scale(.7); }
  12%  { opacity: 1;   transform: translateY(-20px) scale(1.15); }
  50%  { opacity: 1;   transform: translateY(-130px) scale(1); }
  100% { opacity: 0;   transform: translateY(-320px) scale(.75); }
}

/* ── Mario-style runner ── */
.runner-wrap {
  position: relative; overflow: hidden;
  height: 56px; margin-top: .9rem; border-radius: 12px;
  background: linear-gradient(90deg, rgba(124,58,237,.07), rgba(245,158,11,.07));
  border: 1.5px dashed rgba(124,58,237,.18);
}
.runner-ground {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg,
    rgba(124,58,237,.25) 0px, rgba(124,58,237,.25) 12px,
    transparent 12px, transparent 20px);
}
.runner-track {
  position: absolute;
  bottom: 6px;
  animation: runner-slide 2.4s linear infinite;
}
.runner-char {
  display: inline-block;
  line-height: 0;
  animation: runner-bounce .32s ease-in-out infinite alternate;
  transform-origin: bottom center;
}
.runner-char svg { display: block; }
.runner-thinking {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; font-weight: 700; color: var(--brand); opacity: .7;
  letter-spacing: .04em; text-transform: uppercase;
}
@keyframes runner-slide {
  0%   { right: -60px; }
  100% { right: calc(100% + 20px); }
}
@keyframes runner-bounce {
  0%   { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-9px) scaleY(.92); }
}

/* Mastery progress bar */
.mastery-bar-wrap { margin-bottom: 1.5rem; }
.mastery-bar-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.mastery-bar-label { font-size: .78rem; font-weight: 800; color: var(--gray-600); }
.mastery-bar-pct { font-size: .78rem; font-weight: 900; color: var(--brand); margin-left: auto; }
.mastery-bar-track {
  height: 18px; background: var(--gray-200); border-radius: 99px; position: relative;
  /* Inner shadow gives it a tank/tube feel without making it heavy */
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
  overflow: visible;
}
.mastery-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #7C3AED, #A855F7);
  transition: width .5s, background .4s;
  position: relative;
}
/* Above-80% mastered state: gradient flips to gold so the bar visibly
   "tips over" into the mastered zone. */
.mastery-bar-fill.bar-mastered {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}
/* Glowing leading-edge marker — sits at the right edge of the fill so the
   eye tracks where the bar is "climbing to" right now. */
.mastery-bar-fill::after {
  content: "";
  position: absolute;
  right: -4px; top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: white;
  border: 2px solid currentColor;
  box-shadow: 0 0 8px rgba(168,85,247,.7);
  transform: translateY(-50%);
}
.mastery-bar-fill.bar-mastered::after {
  box-shadow: 0 0 10px rgba(245,158,11,.8);
}
.mastery-bar-fill.bar-pulse::after {
  animation: cursor-burst .55s ease-out;
}
@keyframes cursor-burst {
  0%   { transform: translateY(-50%) scale(1);   box-shadow: 0 0 0 0 rgba(168,85,247,.6); }
  50%  { transform: translateY(-50%) scale(1.4); box-shadow: 0 0 0 8px rgba(168,85,247,0); }
  100% { transform: translateY(-50%) scale(1);   box-shadow: 0 0 8px rgba(168,85,247,.7); }
}
.mastery-bar-fill.bar-pulse {
  animation: mastery-pulse .55s ease-out;
}
@keyframes mastery-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(168,85,247,.55); filter: brightness(1); }
  40%  { box-shadow: 0 0 0 6px rgba(168,85,247,0);   filter: brightness(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(168,85,247,0);     filter: brightness(1); }
}
.mastery-bar-goal {
  position: absolute; top: -2px; bottom: -2px; left: 80%;
  width: 3px; background: var(--amber);
  box-shadow: 0 0 6px rgba(245,158,11,.45);
  z-index: 2;
}
.mastery-bar-notch {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,.7);
  pointer-events: none;
  z-index: 1;
}
.mastery-bar-milestone {
  font-size: .78rem; color: var(--gray-600);
  margin: .45rem 0 0; line-height: 1.4;
}
.mastery-bar-milestone strong { color: var(--amber); }

/* Freeze token badge inside the streak pill */
.freeze-badge {
  display: inline-flex; align-items: center; gap: .15rem;
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white;
  font-size: .7rem; font-weight: 900;
  padding: .12rem .4rem .12rem .25rem;
  border-radius: 99px;
  margin-left: .35rem;
  box-shadow: 0 2px 4px rgba(14,165,233,.35);
}
.freeze-badge .icon { width: 12px; height: 12px; }

/* Streak-freeze save toast */
.freeze-toast {
  position: fixed; top: 90px; left: 50%;
  transform: translateX(-50%) scale(.85);
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: white; font-weight: 900; font-size: 1rem;
  padding: .7rem 1.4rem; border-radius: 99px;
  box-shadow: 0 8px 28px rgba(14,165,233,.45);
  display: inline-flex; align-items: center; gap: .45rem;
  z-index: 9998; opacity: 0;
  animation: freeze-toast-show 3.2s ease forwards;
}
.freeze-toast .icon { width: 18px; height: 18px; }
@keyframes freeze-toast-show {
  0%   { transform: translateX(-50%) scale(.85); opacity: 0; }
  8%   { transform: translateX(-50%) scale(1.05); opacity: 1; }
  16%  { transform: translateX(-50%) scale(1); opacity: 1; }
  88%  { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(.95); opacity: 0; }
}

/* Compress mode — when answer is being shown, shrink the question card so
   feedback + Next button fit in the viewport without scrolling. Triggered by
   .question-card.compressed class added in showFeedback. */
.question-card.compressed {
  padding: 1rem 1.5rem;
  transition: padding .25s ease;
}
.question-card.compressed .question-text {
  font-size: 1rem;
  margin-bottom: .6rem;
}
.question-card.compressed .choices { gap: .35rem; }
.question-card.compressed .choice-btn {
  padding: .5rem .8rem;
  font-size: .92rem;
}
.question-card.compressed .hint-row { display: none; }

/* Question card */
.question-card {
  background: var(--card);
  border: 2px solid var(--brand-lt);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  /* When scrollIntoView lands here (e.g. on Next click), leave room for the
     sticky navbar (60px) + sticky practice header (~180px) so the question
     text isn't hidden underneath. */
  scroll-margin-top: 250px;
}
@media (max-width: 600px) {
  .question-card { scroll-margin-top: 200px; }
}
.question-num { font-size: .78rem; font-weight: 800; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; }
.question-text { font-size: 1.2rem; font-weight: 700; line-height: 1.55; margin-bottom: 1.5rem; }
/* Container for AI-attached question charts (bar, line, pie, coord plane).
   Sized to give the chart room without overpowering the question text. */
.question-chart {
  margin: 0 0 1.25rem;
  padding: .75rem;
  background: #fafafa;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
}
.question-chart canvas { max-width: 100%; height: auto; }
.question-chart svg { max-width: 100%; }
.q-emoji { font-size: 1.7em; vertical-align: -.15em; line-height: 1; letter-spacing: .04em; }

/* Quiz "selected" state — replaces the green/red feedback during a quiz with
   a subtle confirmation that the kid clicked something. No grading signal. */
.choice-btn.quiz-selected {
  background: var(--brand-lt);
  border-color: var(--brand);
  color: var(--brand-dk);
  font-weight: 800;
}

/* Trophy Case — a celebration page showing everything the kid has earned.
   Designed to be parent-show-off-able. */
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: .65rem;
}
.trophy-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.trophy-stars { font-size: .9rem; letter-spacing: .04em; margin-bottom: .35rem; }
.trophy-stars .star { color: var(--gray-200); }
.trophy-stars .star.filled { color: var(--amber); }
.trophy-name { font-weight: 800; font-size: .9rem; line-height: 1.3; margin-bottom: .3rem; }
.trophy-sub  { font-size: .7rem; color: var(--gray-500); }

.trophy-avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: .45rem;
}

/* Grade Champion — top-tier achievement. Large gold gradient cards so they
   visually outrank the per-skill trophies and the avatars below. */
.grade-champ-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
}
.grade-champ-card {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
  border-radius: var(--radius);
  padding: 1rem .85rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(217,119,6,.3);
  position: relative;
  overflow: hidden;
}
.grade-champ-card::before {
  content: "";
  position: absolute; top: -30%; right: -30%;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(255,255,255,.25) 0%, transparent 70%);
  pointer-events: none;
}
.grade-champ-trophy { line-height: 1; margin-bottom: .35rem; }
.grade-champ-label  { font-weight: 900; font-size: 1.1rem; letter-spacing: .02em; }
.grade-champ-sub    { font-weight: 800; font-size: .65rem; letter-spacing: .25em; opacity: .9; margin-top: .15rem; }
.grade-champ-detail { font-size: .72rem; opacity: .85; margin-top: .55rem; }
.trophy-avatar {
  position: relative;
  width: 54px; height: 54px;
  border: 2px solid;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  cursor: default;
}
.trophy-avatar-locked {
  filter: grayscale(.85) opacity(.4);
  border-color: var(--gray-300) !important;
  background: var(--gray-100) !important;
}
.trophy-avatar-lock {
  position: absolute; right: -2px; bottom: -2px;
  background: var(--gray-500);
  border-radius: 50%;
  padding: 2px;
  display: flex; align-items: center; justify-content: center;
}

/* Twemoji renders each emoji as an inline <img class="emoji" src="...svg">.
   Default styling so they line up with surrounding text and scale with font-size. */
img.emoji {
  height: 1em;
  width: 1em;
  vertical-align: -.15em;
  display: inline-block;
}

/* Admin override button — small, dotted-border, only visible to admins on
   skill_tree. Click sends a POST that's gated by @admin_required (and the
   admin_pin unlock flow if the session isn't fresh). */
.admin-unlock-btn {
  background: transparent;
  border: 1px dashed #ef4444;
  color: #b91c1c;
  font-size: .65rem;
  font-weight: 800;
  padding: .1rem .4rem;
  border-radius: 99px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-family: inherit;
  transition: background .12s ease;
}
.admin-unlock-btn:hover { background: #fef2f2; }

/* Section heading inside admin dashboard — separates Business / Engagement /
   AI Operations groups so KPI rows don't read as one giant blur */
.admin-section-h {
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin: 1.25rem 0 .55rem;
}
.admin-section-h:first-of-type { margin-top: .25rem; }

/* AI Operations KPI cards — pale backgrounds with explicit dark text so the
   numbers are readable. Default .kpi-card uses white-on-saturated styling
   which became invisible when we paired it with light fills. */
.kpi-card.kpi-aiops {
  background: white;
  border: 1px solid var(--gray-200);
  color: #111827;
}
.kpi-card.kpi-aiops .kpi-label { color: #4b5563; }
.kpi-card.kpi-aiops .kpi-value { color: #111827; }
.kpi-card.kpi-aiops .kpi-sub   { color: #6b7280; }
.kpi-card.kpi-aiops .kpi-sub a { color: var(--brand); font-weight: 700; }

/* Per-card accent strip on the left so each AI Ops card is visually distinct
   while keeping the text crisp dark-on-white. */
.kpi-card.kpi-aiops-spend  { border-left: 4px solid #6b7280; }
.kpi-card.kpi-aiops-opus   { border-left: 4px solid #9333ea; background: #faf5ff; }
.kpi-card.kpi-aiops-clean  { border-left: 4px solid #10b981; background: #f0fdf4; }
.kpi-card.kpi-aiops-flags-ok    { border-left: 4px solid #6b7280; }
.kpi-card.kpi-aiops-flags-alert {
  border-left: 4px solid #dc2626;
  background: #fef2f2;
}
.kpi-card.kpi-aiops-flags-alert .kpi-label,
.kpi-card.kpi-aiops-flags-alert .kpi-value { color: #991b1b; }
.kpi-card.kpi-aiops-flags-alert .kpi-sub a { color: #991b1b; }

/* Beta badge next to the brand mark — signals product is still iterating
   so users / parents calibrate expectations. Tightly coupled to .nav-brand
   so it inherits the brand color but stands out visually. */
.beta-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .08rem .42rem;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .12em;
  background: #F59E0B;
  color: white;
  border-radius: 99px;
  vertical-align: .35em;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(245,158,11,.4);
  text-transform: uppercase;
}
/* Larger emoji renderings inside known visual containers */
.q-emoji img.emoji { height: 1em; width: 1em; }
.avatar-emoji img.emoji,
.practice-avatar-mini img.emoji,
.switcher-avatar img.emoji,
.avatar-unlock-emoji img.emoji { height: 1em; width: 1em; vertical-align: middle; }

/* "Cooling" state on Next button — brief pause while celebration plays out. */
.next-btn-cooling {
  opacity: .55;
  cursor: wait;
  position: relative;
  pointer-events: none;
}
.next-btn-cooling::after {
  content: "✨";
  margin-left: .35rem;
  display: inline-block;
  animation: cool-spin 1.2s linear infinite;
}
@keyframes cool-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.choices { display: flex; flex-direction: column; gap: .6rem; }
.choice-btn {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem; font-weight: 700;
  text-align: left;
  transition: border-color .12s, background .12s, transform .1s;
  width: 100%;
}
.choice-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-lt); transform: translateX(3px); }
.choice-btn:disabled { cursor: default; }
.choice-letter {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .88rem; flex-shrink: 0;
}
.choice-btn.correct-ans  { border-color: var(--green); background: var(--green-lt); }
.choice-btn.correct-ans .choice-letter { background: var(--green); color: white; }
.choice-btn.wrong-ans    { border-color: var(--red); background: var(--red-lt); }
.choice-btn.wrong-ans .choice-letter   { background: var(--red); color: white; }

/* Hint */
.hint-row { margin-top: 1rem; display: flex; gap: .75rem; align-items: flex-start; }
.hint-btn { flex-shrink: 0; }
.hint-box {
  background: #FFFBEB;
  border: 2px solid #FCD34D;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .88rem; font-weight: 600; color: #92400e;
  line-height: 1.5;
  flex: 1;
}

/* Feedback */
.feedback-area {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--gray-100);
}
.feedback-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.feedback-icon { font-size: 1.6rem; }
.feedback-msg { font-size: 1.05rem; font-weight: 900; }
.feedback-msg.correct { color: var(--green); }
.feedback-msg.wrong   { color: var(--red); }
.explanation { font-size: .9rem; color: var(--gray-600); font-weight: 600; line-height: 1.5; margin-bottom: 1.25rem; }

/* Mastery modal */
.mastery-modal {
  position: fixed; inset: 0;
  background: rgba(109,40,217,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
}
.mastery-modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 400px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: pop-in .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop-in {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.mastery-trophy { font-size: 4rem; margin-bottom: .75rem; }
.mastery-modal-box h2 { font-size: 1.7rem; font-weight: 900; margin-bottom: .4rem; }
.mastery-modal-box p { color: var(--gray-600); font-weight: 600; margin-bottom: .5rem; }
.mastery-stars { font-size: 1.8rem; margin-bottom: 1.25rem; }
.mastery-xp { font-size: 1rem; font-weight: 800; color: var(--amber); margin-bottom: 1.25rem; }

/* Flag (report a question) */
.flag-row {
  margin-top: .9rem;
  display: flex; align-items: center; gap: .6rem;
  font-size: .85rem;
}
.flag-link {
  background: none; border: none; padding: 0;
  color: var(--gray-500);
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.flag-link:hover { color: var(--gray-700); }
.flag-thanks { color: var(--green-600, #047857); font-weight: 700; }

.flag-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 350;
  backdrop-filter: blur(3px);
}
.flag-modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  max-width: 380px; width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop-in .25s ease-out;
}
.flag-modal-box h3 { font-size: 1.2rem; font-weight: 900; margin: 0 0 .35rem; }
.flag-sub { color: var(--gray-600); font-size: .9rem; margin-bottom: 1rem; }
.flag-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flag-option {
  padding: .7rem .9rem;
  border: 1.5px solid var(--gray-200, #e5e7eb);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  font-size: .92rem;
}
.flag-option:hover { border-color: var(--purple, #7c3aed); background: #faf5ff; }

/* Confetti */
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 11px; height: 11px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall linear forwards;
}

/* ── Quiz ── */
.quiz-header { margin-bottom: 1.5rem; }
.quiz-instructions { color: var(--gray-600); font-size: .9rem; font-weight: 600; margin-top: .25rem; }
.quiz-progress-bar-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; font-size: .85rem; font-weight: 700; color: var(--gray-600); }
.quiz-progress-bar-wrap .mastery-bar-track { flex: 1; height: 10px; }

#result-breakdown { text-align: left; margin: 1rem 0; max-height: 260px; overflow-y: auto; }
.result-item { padding: .45rem 0; border-bottom: 1px solid var(--gray-100); font-size: .83rem; font-weight: 600; }
.ri-correct { color: var(--green); }
.ri-wrong   { color: var(--red); }
#result-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }

/* ── Avatar Selection Page ── */
.avatar-select-container { max-width: 860px; margin: 0 auto; padding: 2rem 1rem; }
.avatar-select-header { text-align: center; margin-bottom: 2rem; }
.avatar-select-header h1 { font-size: 2.2rem; font-weight: 900; }
.avatar-select-sub { font-size: 1.1rem; color: var(--gray-500); font-weight: 600; margin-top: .5rem; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.avatar-card {
  background: var(--av-bg, #F5F3FF);
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 1.2rem .8rem;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
}
.avatar-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); border-color: var(--av-color, var(--brand)); }
.avatar-card.selected { border-color: var(--av-color, var(--brand)); box-shadow: 0 0 0 4px rgba(124,58,237,.18); transform: translateY(-4px); }
.avatar-emoji-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: white; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; box-shadow: 0 4px 12px rgba(0,0,0,.1);
  border: 3px solid var(--av-color, var(--brand));
}
.avatar-card-name { font-size: .82rem; font-weight: 800; color: var(--gray-800); line-height: 1.2; }
.avatar-card-desc { font-size: .72rem; color: var(--gray-500); font-weight: 600; }
.avatar-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--av-color, var(--brand)); color: white;
  font-size: .75rem; font-weight: 900;
  display: none; align-items: center; justify-content: center;
}
.avatar-card.selected .avatar-check { display: flex; }
.avatar-select-footer { text-align: center; }

/* ── Student card avatar ── */
.student-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: .5rem; }
.student-avatar-emoji {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; box-shadow: 0 4px 14px rgba(0,0,0,.1);
  border: 3px solid white;
}
.avatar-name-tag { font-size: .72rem; font-weight: 800; text-align: center; }

/* ── Skill tree avatar header ── */
.skill-tree-avatar-row { display: flex; align-items: center; gap: 1rem; }
.avatar-change-wrap {
  position: relative; flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
}
.avatar-change-wrap:hover .skill-tree-avatar-bubble { box-shadow: 0 0 0 4px rgba(124,58,237,.25); }
.avatar-change-hint {
  position: absolute; bottom: -2px; right: -4px;
  font-size: .85rem; background: white; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.skill-tree-avatar-bubble {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  flex-shrink: 0; transition: box-shadow .2s;
}
.skill-tree-hero-line { display: flex; align-items: center; gap: .6rem; margin-top: .2rem; flex-wrap: wrap; }
.hero-name-tag { font-size: .8rem; font-weight: 800; }
.grade-tag {
  font-size: .75rem; font-weight: 700; color: var(--gray-500);
  background: var(--gray-100); border-radius: 99px; padding: .15rem .6rem;
}
.change-char-link {
  font-size: .72rem; font-weight: 700; color: var(--brand);
  text-decoration: none; opacity: .75;
  border: 1.5px solid rgba(124,58,237,.25); border-radius: 99px;
  padding: .12rem .55rem;
  transition: opacity .15s, background .15s;
}
.change-char-link:hover { opacity: 1; background: rgba(124,58,237,.07); }

/* ── Free trial badge ── */
.free-badge {
  position: absolute; top: -8px; right: -8px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white; font-size: .55rem; font-weight: 900;
  padding: .15rem .35rem; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(16,185,129,.4);
  animation: free-pulse 2s ease-in-out infinite;
}
@keyframes free-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.node-free {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border: 3px dashed #10B981;
  animation: node-free-glow 2.5s ease-in-out infinite;
}
@keyframes node-free-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.3); }
  50% { box-shadow: 0 0 0 8px rgba(16,185,129,.1); }
}

/* ── Exciting Practice Stats Bar ── */
.practice-avatar-mini {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.practice-stats-bar {
  display: flex; gap: .55rem; flex-wrap: wrap; align-items: center;
}
.p-stat {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem; border-radius: 14px;
  font-weight: 800; white-space: nowrap;
}
.p-stat-label { font-size: .6rem; font-weight: 900; letter-spacing: .06em; opacity: .65; display: block; line-height: 1; text-transform: uppercase; }

/* Level pill */
.p-stat-level { background: linear-gradient(135deg, #7C3AED, #6D28D9); color: white; }
.level-ring { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.level-svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.level-track { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 3; }
.level-fill { fill: none; stroke: #FBBF24; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.mastery-arc-fill { fill: none; stroke: #34D399; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.level-num {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: .82rem; font-weight: 900; color: white;
}
.mastery-mini-pct {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: .62rem; font-weight: 900; color: #065f46;
}
.level-info { display: flex; flex-direction: column; }
.p-stat-xp { font-size: .9rem; font-weight: 900; color: #FDE68A; line-height: 1; }

/* Streak pill */
.p-stat-streak { background: linear-gradient(135deg, #DC2626, #EF4444); color: white; }
.streak-fire { font-size: 1.3rem; animation: fire-dance .8s ease-in-out infinite alternate; }
@keyframes fire-dance {
  0%  { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}
.streak-count { font-size: 1.2rem; font-weight: 900; line-height: 1; color: white; }
.streak-count small { font-size: .65rem; opacity: .8; }

/* Session XP pill */
.p-stat-xp-session { background: linear-gradient(135deg, #F59E0B, #D97706); color: white; }
.session-star { font-size: 1.3rem; animation: star-spin 3s linear infinite; }
@keyframes star-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}
.session-xp-count { font-size: 1rem; font-weight: 900; color: white; line-height: 1; }

/* Difficulty pill */
.p-stat-diff { background: linear-gradient(135deg, #0891B2, #0E7490); color: white; text-align: center; }
.diff-bolts { font-size: .85rem; letter-spacing: -.05em; }

/* Done pill */
.p-stat-done { background: linear-gradient(135deg, #10B981, #059669); color: white; }
.done-check { font-size: 1.1rem; }
.done-count { font-size: 1.2rem; font-weight: 900; line-height: 1; color: white; }

/* Mastery ring pill */
.practice-timer {
  position: absolute; top: 1.1rem; right: 1.25rem;
  font-size: .78rem; font-weight: 700; color: var(--gray-400);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
  pointer-events: none;
}
.p-stat-mastery { background: linear-gradient(135deg, #065f46, #047857); color: white; text-align: center; }
.mastery-mini-ring { position: relative; width: 36px; height: 36px; }

/* Level-up toast — 2.8s lifetime: pop in (0.3s), hold (2.2s), fade out (0.3s) */
.levelup-toast {
  position: fixed; top: 90px; left: 50%; transform: translateX(-50%) scale(.8);
  background: linear-gradient(135deg, #7C3AED, #F59E0B);
  color: white; font-size: 1.25rem; font-weight: 900;
  padding: .85rem 1.9rem; border-radius: 99px;
  box-shadow: 0 10px 40px rgba(124,58,237,.5);
  z-index: 9998; opacity: 0;
  animation: levelup-show 2.8s ease forwards;
}
@keyframes levelup-show {
  0%   { transform: translateX(-50%) scale(.8);  opacity: 0; }
  10%  { transform: translateX(-50%) scale(1.1); opacity: 1; }   /* pop in */
  18%  { transform: translateX(-50%) scale(1);   opacity: 1; }   /* settle */
  88%  { transform: translateX(-50%) scale(1);   opacity: 1; }   /* hold visible */
  100% { transform: translateX(-50%) scale(.95); opacity: 0; }   /* fade out */
}

/* ── Warmup card ── */
.warmup-card {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  border-radius: 20px; padding: 1.5rem; margin-bottom: 1.5rem;
  color: white; box-shadow: 0 8px 32px rgba(99,102,241,.25);
}
.warmup-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.warmup-badge {
  background: rgba(255,255,255,.25); font-size: .8rem; font-weight: 900;
  padding: .25rem .7rem; border-radius: 99px; letter-spacing: .04em;
}
.warmup-sub { font-size: .78rem; opacity: .85; font-weight: 600; }
.warmup-card .question-text { color: white; font-size: 1.05rem; }
.warmup-card .choice-btn {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: white;
}
.warmup-card .choice-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.25); border-color: white;
}
.warmup-card .choice-letter { background: rgba(255,255,255,.2); color: white; }
.warmup-feedback { background: rgba(255,255,255,.12); border-radius: 12px; padding: .8rem; }
.warmup-card .explanation { color: rgba(255,255,255,.9); }

/* ── Daily limit reached card ── */
.daily-limit-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #d1fae5 100%);
  border: 2px solid #6ee7b7;
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 1.5rem;
  box-shadow: 0 8px 32px rgba(16,185,129,.12);
}
.limit-card-emojis { font-size: 2.4rem; letter-spacing: .35rem; margin-bottom: 1rem; }
.limit-card-title {
  font-size: 1.75rem; font-weight: 900; color: #065f46; margin-bottom: 1rem;
}
.limit-card-message {
  font-size: 1.1rem; line-height: 1.65; color: #047857;
  font-weight: 600; max-width: 480px; margin: 0 auto 1.5rem;
}
.limit-card-footer { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.limit-card-sub { font-size: .88rem; color: #6ee7b7; font-weight: 700; letter-spacing: .04em; }

/* ── Parent dashboard daily limit control ── */
.daily-limit-row {
  display: flex; align-items: center; gap: .5rem;
  margin: .6rem 0 .2rem; flex-wrap: wrap;
}
.daily-limit-label { font-size: .78rem; font-weight: 700; color: var(--gray-500); }
.limit-pills { display: flex; gap: .3rem; }
.limit-pill {
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  border: 2px solid var(--gray-200); background: var(--gray-50);
  font-size: .82rem; font-weight: 700; color: var(--gray-500);
  cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.limit-pill:hover { border-color: var(--primary); color: var(--primary); }
.limit-pill.active { background: var(--primary); border-color: var(--primary); color: white; }
.est-time { font-size: .75rem; color: var(--gray-400); font-weight: 600; }
.skills-today-label { font-size: .78rem; color: var(--gray-400); font-weight: 600; margin-bottom: .6rem; }

/* ── Daily Challenge banner on skill tree ── */
.daily-challenge-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #7C3AED 0%, #F59E0B 100%);
  border-radius: 16px; padding: 1rem 1.25rem;
  margin-bottom: 1.25rem; color: white;
  box-shadow: 0 6px 24px rgba(124,58,237,.3);
}
.daily-challenge-banner.daily-done {
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 6px 24px rgba(4,120,87,.25);
}
.daily-banner-left { display: flex; align-items: center; gap: .9rem; }
.daily-banner-icon { font-size: 2rem; line-height: 1; }
.daily-banner-title { font-size: 1rem; font-weight: 900; }
.daily-banner-sub   { font-size: .75rem; opacity: .85; font-weight: 600; margin-top: .1rem; }
.daily-banner-btn   { background: white; color: #7C3AED; font-weight: 800; white-space: nowrap; }
.daily-banner-btn:hover { background: #f3f4f6; }
.daily-done-check {
  font-size: .85rem; font-weight: 900; background: rgba(255,255,255,.2);
  padding: .3rem .8rem; border-radius: 99px;
}

/* ── Daily Challenge page ── */
.daily-container { max-width: 680px; margin: 0 auto; padding: 2rem 1rem; }
.daily-header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.daily-header h1 { font-size: 1.6rem; font-weight: 900; }
.daily-avatar-bubble {
  width: 56px; height: 56px; border-radius: 50%; border: 3px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); flex-shrink: 0;
}
.daily-streak-row { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; flex-wrap: wrap; }
.daily-streak-badge {
  font-size: .78rem; font-weight: 800; color: #D97706;
  background: #FEF3C7; border-radius: 99px; padding: .2rem .6rem;
}
.daily-date-badge {
  font-size: .75rem; font-weight: 700; color: var(--gray-500);
  background: var(--gray-100); border-radius: 99px; padding: .2rem .6rem;
}
.daily-progress-bar-wrap { margin-bottom: 1.25rem; }
.daily-progress-track {
  height: 8px; background: var(--gray-200); border-radius: 99px;
  overflow: hidden; margin-bottom: .4rem;
}
.daily-progress-fill {
  height: 100%; background: linear-gradient(90deg, #7C3AED, #F59E0B);
  border-radius: 99px; transition: width .4s ease;
}
.daily-progress-label { font-size: .75rem; font-weight: 700; color: var(--gray-500); }
.daily-skill-badge {
  font-size: .72rem; font-weight: 800; color: var(--brand);
  background: rgba(124,58,237,.08); border-radius: 99px;
  padding: .2rem .7rem; display: inline-block; margin-bottom: .6rem;
}
/* Results */
.daily-results-box { text-align: center; }
.daily-score-row { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .8rem 0; }
.daily-score-big { font-size: 2.2rem; font-weight: 900; color: var(--brand); }
.daily-xp-earned {
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.daily-streak-result { font-size: 1rem; font-weight: 800; color: #D97706; margin-bottom: .8rem; }
.daily-breakdown { text-align: left; margin-top: .5rem; }
/* Done card */
.daily-done-card {
  text-align: center; background: var(--card); border-radius: 20px;
  padding: 3rem 2rem; box-shadow: var(--shadow);
}
.daily-done-icon { font-size: 4rem; margin-bottom: 1rem; }
.daily-done-card h2 { font-size: 1.6rem; font-weight: 900; margin-bottom: .5rem; }
.daily-streak-big { font-size: 1.8rem; font-weight: 900; color: #D97706; margin-top: .8rem; }

/* ── Admin Dashboard ── */
.admin-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }
.admin-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.8rem; font-weight: 900; }
.admin-badge {
  background: #FEE2E2; color: #DC2626; font-size: .72rem; font-weight: 800;
  padding: .2rem .7rem; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em;
}
.nav-admin { color: #DC2626 !important; font-weight: 800 !important; }

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.kpi-card {
  border-radius: 14px; padding: 1.1rem 1.2rem;
  color: white; box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.kpi-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.kpi-value { font-size: 2rem; font-weight: 900; line-height: 1.1; margin: .2rem 0; }
.kpi-sub { font-size: .72rem; opacity: .8; font-weight: 700; }
.kpi-purple  { background: linear-gradient(135deg, #7C3AED, #6D28D9); }
.kpi-blue    { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.kpi-green   { background: linear-gradient(135deg, #10B981, #059669); }
.kpi-amber   { background: linear-gradient(135deg, #F59E0B, #D97706); }
.kpi-teal    { background: linear-gradient(135deg, #0891B2, #0E7490); }
.kpi-pink    { background: linear-gradient(135deg, #DB2777, #BE185D); }
.kpi-indigo  { background: linear-gradient(135deg, #4F46E5, #4338CA); }
.kpi-emerald { background: linear-gradient(135deg, #047857, #065F46); }

.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.admin-card {
  background: white; border-radius: 14px; padding: 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); border: 1px solid var(--gray-100);
}
.admin-card h3 { font-size: 1rem; font-weight: 900; margin-bottom: 1rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-table th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); font-weight: 800; padding: .4rem .5rem; border-bottom: 2px solid var(--gray-100); text-align: left; }
.admin-table td { padding: .5rem; border-bottom: 1px solid var(--gray-100); font-weight: 600; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.rank-cell { font-weight: 900; color: var(--gray-400); font-size: .85rem; }
.fire-badge { background: #FEE2E2; color: #DC2626; padding: .15rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.status-pill { font-size: .7rem; font-weight: 800; padding: .15rem .55rem; border-radius: 99px; }
.status-active { background: #D1FAE5; color: #065f46; }
.status-inactive { background: #F3F4F6; color: #6B7280; }
.acc-pill { font-size: .72rem; font-weight: 800; padding: .1rem .45rem; border-radius: 99px; }
.acc-good { background: #D1FAE5; color: #065f46; }
.acc-ok   { background: #FEF3C7; color: #92400E; }
.acc-bad  { background: #FEE2E2; color: #DC2626; }

.grade-bars { display: flex; flex-direction: column; gap: .5rem; }
.grade-bar-row { display: flex; align-items: center; gap: .6rem; }
.grade-bar-label { font-size: .8rem; font-weight: 800; color: var(--gray-600); width: 22px; }
.grade-bar-track { flex: 1; height: 10px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.grade-bar-fill { height: 100%; background: linear-gradient(90deg, #7C3AED, #2563EB); border-radius: 99px; }
.grade-bar-count { font-size: .78rem; font-weight: 800; color: var(--gray-500); min-width: 20px; text-align: right; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .practice-top { flex-direction: column; align-items: flex-start; }
  .question-text { font-size: 1.05rem; }
  .skill-path { padding: 1rem; }
  .skill-node { width: 58px; height: 58px; }
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(2, 1fr); }
  .practice-stats-bar { gap: .4rem; }
}

/* ── Site footer ── */
.site-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap;
  padding: 1.5rem 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--gray-100);
  font-size: .8rem; color: var(--gray-400); font-weight: 600;
}
.site-footer a { color: var(--gray-400); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }

/* ── Legal pages ── */
.legal-container {
  max-width: 720px; margin: 2rem auto; padding: 0 1.5rem 4rem;
}
.legal-container h1 {
  font-size: 2rem; font-weight: 900; color: var(--gray-800); margin-bottom: .25rem;
}
.legal-updated { font-size: .82rem; color: var(--gray-400); margin-bottom: 2rem; }
.legal-container h2 {
  font-size: 1.1rem; font-weight: 800; color: var(--gray-700);
  margin: 2rem 0 .5rem;
}
.legal-container p, .legal-container li {
  font-size: .95rem; line-height: 1.75; color: var(--gray-600);
}
.legal-container ul { padding-left: 1.25rem; margin: .5rem 0; }
.legal-container a { color: var(--primary); }

/* ── Parent PIN lock ── */
.pin-lock-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 3rem;
}
.pin-lock-card {
  background: var(--card); border: 2px solid var(--brand-lt);
  border-radius: var(--radius); padding: 2.5rem 2rem 2rem;
  width: 100%; max-width: 360px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.pin-lock-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.pin-lock-title { font-size: 1.5rem; font-weight: 900; margin-bottom: .25rem; }
.pin-lock-sub { font-size: .88rem; color: var(--gray-400); font-weight: 600; margin-bottom: 1.5rem; }
.pin-no-pin-msg { color: var(--gray-500); font-size: .9rem; font-weight: 700; }

.pin-dots {
  display: flex; justify-content: center; gap: 1rem;
  margin-bottom: 1rem;
}
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--gray-300); background: transparent;
  transition: background .15s, border-color .15s;
}
.pin-dot.filled { background: var(--brand); border-color: var(--brand); }

.pin-error {
  color: var(--red); font-size: .82rem; font-weight: 800;
  margin-bottom: .5rem;
}

.pin-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .6rem; margin-top: 1.25rem;
}
.pin-key {
  width: 100%; aspect-ratio: 1;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--gray-50); font-family: 'Nunito', sans-serif;
  font-size: 1.4rem; font-weight: 800; color: var(--gray-800);
  cursor: pointer; transition: background .12s, transform .08s;
  display: flex; align-items: center; justify-content: center;
}
.pin-key:hover:not(:disabled) { background: var(--brand-lt); border-color: var(--brand); }
.pin-key:active:not(:disabled) { transform: scale(.93); }
.pin-key-clear { font-size: 1.1rem; color: var(--gray-500); }
.pin-key-blank { background: transparent; border-color: transparent; cursor: default; }
.pin-key:disabled { opacity: 0; }

@keyframes pin-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.pin-shake { animation: pin-shake .45s ease; }
.pin-skip-link { display: block; margin-top: 1.25rem; font-size: .8rem; color: var(--gray-400); font-weight: 700; }

/* ── Dashboard PIN status ── */
.pin-setup-banner {
  background: var(--amber-lt); border: 1.5px solid #FCD34D;
  border-radius: var(--radius-sm); padding: .7rem 1rem;
  font-size: .85rem; font-weight: 700; color: #92400e;
  margin-top: .75rem; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.pin-set-note { font-size: .78rem; color: var(--gray-400); font-weight: 700; margin-top: .5rem; }
.pin-set-note a { color: var(--gray-400); text-decoration: underline; }
.link-btn {
  background: none; border: none; font-family: inherit;
  font-size: inherit; color: var(--gray-400); font-weight: 700;
  cursor: pointer; text-decoration: underline; padding: 0;
}

/* ── SVG icon helpers ── */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-inline { vertical-align: text-bottom; }
.icon-pill { vertical-align: middle; margin-top: -2px; }

.top-stat-icon {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.top-stat-icon-amber { background: var(--amber-lt); color: var(--amber); }
.top-stat-icon-red   { background: var(--red-lt);   color: var(--red);   }
.top-stat-icon-green { background: var(--green-lt); color: var(--green); }

.pencil-tip {
  font-size: .75rem; color: var(--gray-400); font-weight: 600;
  letter-spacing: .01em; white-space: nowrap;
}

.switch-student-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700; color: var(--gray-400);
  text-decoration: none; margin-bottom: .75rem;
  transition: color .15s;
}
.switch-student-link:hover { color: var(--primary); text-decoration: none; }

/* ── Navbar student switcher ── */
.nav-student-switcher { position: relative; }
.nav-student-btn {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.2); color: white;
  padding: .28rem .85rem; border-radius: 99px;
  font-family: 'Nunito', sans-serif; font-size: .82rem; font-weight: 800;
  border: none; cursor: pointer; transition: background .15s;
}
.nav-student-btn:hover { background: rgba(255,255,255,.3); }

.nav-switcher-dropdown {
  display: none; position: absolute; top: calc(100% + .5rem); right: 0;
  background: white; border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 160px; overflow: hidden; z-index: 200;
}
.nav-switcher-dropdown.open { display: block; }

.switcher-label {
  font-size: .7rem; font-weight: 800; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem 1rem .3rem;
}
.switcher-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1rem; font-size: .88rem; font-weight: 700;
  color: var(--gray-800); text-decoration: none; transition: background .12s;
}
.switcher-item:hover { background: var(--brand-lt); color: var(--brand); text-decoration: none; }
.switcher-avatar {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.nav-student { /* fallback when no siblings */
  background: rgba(255,255,255,.2); color: white;
  padding: .28rem .85rem; border-radius: 99px;
  font-size: .82rem; font-weight: 800;
}

.nav-switcher-dropdown .switcher-item { color: var(--gray-800); }
.nav-switcher-dropdown .switcher-item:hover { color: var(--brand); }

/* ────────────────────────────────────────────────────────────────────
   Landing pages (home, pricing, how-it-works)
   ──────────────────────────────────────────────────────────────────── */

/* Logged-out nav CTA */
.nav-cta {
  background: var(--amber);
  color: white !important;
  padding: .45rem 1.1rem;
  border-radius: 99px;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,.55);
  text-decoration: none;
}

/* Section helpers */
.lp-section-title {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: .5rem;
  color: var(--gray-800);
  letter-spacing: -.02em;
}
.lp-section-sub {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}
.lp-eyebrow {
  display: inline-block;
  background: var(--brand-lt);
  color: var(--brand-dk);
  padding: .35rem .9rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.lp-accent { color: var(--brand); }
.lp-lede {
  font-size: 1.15rem;
  color: var(--gray-600);
  margin: 1rem 0 1.75rem;
  line-height: 1.55;
}

/* Hero */
.lp-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0 2rem;
}
.lp-hero h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--gray-800);
}
.lp-cta-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.lp-cta-sub {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--gray-600);
  font-weight: 700;
}
.lp-hero-mascot {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lp-mascot-bubble {
  position: absolute;
  top: 10%;
  right: -10px;
  background: white;
  padding: .7rem 1rem;
  border-radius: 16px 16px 16px 4px;
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  border: 2px solid var(--brand-lt);
}
.lp-mascot-bubble strong { color: var(--brand-dk); }
.lp-mascot-bubble small { color: var(--gray-600); }

/* Trust strip */
.lp-trust {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 3rem;
  box-shadow: var(--shadow);
}
.lp-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 100px;
}
.lp-trust-item strong {
  font-size: 1.15rem;
  color: var(--brand-dk);
  font-weight: 900;
}
.lp-trust-item span {
  font-size: .78rem;
  color: var(--gray-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: .15rem;
}

/* Features */
.lp-features { padding: 3rem 0; }
.lp-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.lp-feat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.lp-feat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.lp-feat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.lp-feat-card h3 {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: .4rem;
  color: var(--gray-800);
}
.lp-feat-card p {
  color: var(--gray-600);
  font-size: .92rem;
  line-height: 1.5;
}

/* Try-a-question demo */
.lp-try {
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(124,58,237,.04), rgba(245,158,11,.04));
  border-radius: var(--radius);
  margin: 2rem 0;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.lp-demo-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--brand-lt);
}
.lp-grade-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.lp-grade-btn {
  background: var(--gray-100);
  border: 2px solid transparent;
  color: var(--gray-600);
  padding: .4rem .9rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.lp-grade-btn:hover { background: var(--brand-lt); color: var(--brand-dk); }
.lp-grade-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand-dk);
}
.lp-demo-skill {
  font-size: .78rem;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}
.lp-demo-question {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
}
.lp-demo-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.lp-demo-choice {
  background: white;
  border: 2px solid var(--gray-200);
  color: var(--gray-800);
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.lp-demo-choice:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-lt);
}
.lp-demo-choice:disabled { cursor: default; opacity: .85; }
.lp-demo-choice.correct-ans {
  background: var(--green-lt);
  border-color: var(--green);
  color: #065f46;
}
.lp-demo-choice.wrong-ans {
  background: var(--red-lt);
  border-color: var(--red);
  color: #991b1b;
}
.lp-demo-feedback {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
}
.lp-demo-fb-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  margin-bottom: .4rem;
  font-size: 1.05rem;
}
.lp-demo-fb-row .fb-correct { color: var(--green); font-size: 1.4rem; }
.lp-demo-fb-row .fb-wrong   { color: var(--red);   font-size: 1.4rem; }
.lp-demo-explain {
  color: var(--gray-600);
  font-size: .95rem;
  line-height: 1.5;
}

/* Pricing teaser + pricing page */
.lp-pricing-teaser, .lp-pricing-page { padding: 3rem 0; }
.lp-pricing-head {
  text-align: center;
  margin-bottom: 2.5rem;
}
.lp-pricing-head h1 {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.lp-pricing-head p {
  color: var(--gray-600);
  font-size: 1.05rem;
}
.lp-price-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 720px;
  margin: 1.5rem auto;
}
.lp-price-cards-lg { max-width: 820px; }
.lp-price-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  border: 2px solid var(--gray-200);
}
.lp-price-card p { color: var(--gray-600); font-size: .92rem; margin-bottom: 1rem; }
.lp-price-featured {
  border-color: var(--amber);
  box-shadow: 0 8px 24px rgba(245,158,11,.2);
  transform: scale(1.02);
}
.lp-price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: white;
  padding: .3rem .9rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.lp-price-tag {
  font-size: .82rem;
  font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}
.lp-price-amount {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--gray-800);
  letter-spacing: -.025em;
  line-height: 1;
  margin-bottom: .25rem;
}
.lp-price-amount small {
  font-size: 1rem;
  color: var(--gray-400);
  font-weight: 700;
}
.lp-price-sub {
  color: var(--gray-600);
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 1rem !important;
}
.lp-price-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.lp-price-list li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .92rem;
  color: var(--gray-800);
}
.lp-price-list li svg { flex-shrink: 0; margin-top: 2px; }
.lp-price-foot {
  text-align: center;
  font-size: .8rem;
  color: var(--gray-400);
  margin-top: .75rem;
  font-weight: 700;
}
.lp-guarantee {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  background: var(--green-lt);
  color: #065f46;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 2rem auto 0;
  max-width: 560px;
  font-size: .95rem;
  font-weight: 700;
}

/* Pricing comparison table */
.lp-pricing-table {
  max-width: 720px;
  margin: 3rem auto 0;
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.lp-pricing-table h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-align: center;
}
.lp-pricing-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
}
.lp-pricing-table th, .lp-pricing-table td {
  padding: .7rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}
.lp-pricing-table th {
  font-weight: 800;
  color: var(--gray-600);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lp-pricing-table td:nth-child(2),
.lp-pricing-table td:nth-child(3),
.lp-pricing-table th:nth-child(2),
.lp-pricing-table th:nth-child(3) { text-align: center; }
.lp-pricing-faq { max-width: 820px; margin: 3rem auto 0; }
.lp-pricing-faq h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
}

/* FAQ */
.lp-faq { padding: 3rem 0; }
.lp-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 880px;
  margin: 1rem auto 0;
}
.lp-faq-item {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.lp-faq-item h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-dk);
  margin-bottom: .4rem;
}
.lp-faq-item p {
  color: var(--gray-600);
  font-size: .9rem;
  line-height: 1.55;
}

/* Final CTA */
.lp-final-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dk));
  color: white;
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  margin: 3rem 0 1rem;
}
.lp-final-cta h2 {
  font-size: 2rem;
  font-weight: 900;
  margin: 1rem 0 .5rem;
  letter-spacing: -.02em;
}
.lp-final-cta p {
  margin-bottom: 1.5rem;
  opacity: .9;
  font-size: 1.05rem;
}

/* How-it-works */
.lp-how-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 3rem;
}
.lp-how-hero h1 {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: .25rem 0 1rem;
}
.lp-how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0;
}
.lp-how-step {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--brand);
}
.lp-how-num {
  position: absolute;
  top: -16px;
  right: 16px;
  background: var(--brand);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .92rem;
  box-shadow: var(--shadow);
}
.lp-how-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--brand-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.lp-how-step h3 {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: .4rem;
}
.lp-how-step p { color: var(--gray-600); font-size: .92rem; line-height: 1.55; }

.lp-how-science { padding: 3rem 0; }
.lp-science-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 880px;
  margin: 1.5rem auto 0;
}
.lp-science-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--amber);
}
.lp-science-card h3 {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: .4rem;
  color: var(--gray-800);
}
.lp-science-card p {
  color: var(--gray-600);
  font-size: .9rem;
  line-height: 1.55;
}

/* Mobile */
@media (max-width: 760px) {
  .lp-hero, .lp-how-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem 0;
  }
  .lp-hero h1, .lp-how-hero h1 { font-size: 2.1rem; }
  .lp-cta-row { justify-content: center; }
  .lp-cta-sub { justify-content: center; }
  .lp-mascot-bubble { display: none; }
  .lp-price-cards { grid-template-columns: 1fr; }
  .lp-price-featured { transform: none; }
  .lp-faq-grid { grid-template-columns: 1fr; }
  .lp-section-title { font-size: 1.6rem; }
  .lp-final-cta h2 { font-size: 1.6rem; }
  .lp-pricing-head h1 { font-size: 1.8rem; }
  .lp-demo-choices { grid-template-columns: 1fr; }
}

/* ── Audio read-aloud button ── */
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--brand-lt);
  color: var(--brand-dk);
  border: 2px solid transparent;
  border-radius: 99px;
  padding: .35rem .75rem;
  font-weight: 800;
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  vertical-align: middle;
}
.audio-btn:hover { background: var(--brand); color: white; border-color: var(--brand-dk); }
.audio-btn.speaking {
  background: var(--brand);
  color: white;
  animation: audio-pulse 1s ease-in-out infinite;
}
@keyframes audio-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,.5); }
  50%      { box-shadow: 0 0 0 8px rgba(124,58,237,0); }
}
.audio-btn-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }


/* ────────────────────────────────────────────────────────────────────
   Parent Dashboard (pd-) — re-laid out for aesthetic consistency
   ──────────────────────────────────────────────────────────────────── */

.pd-welcome {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 2px solid var(--brand-lt);
}
.pd-welcome h1 {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -.015em;
  color: var(--gray-800);
  margin: 0 0 .65rem;
}
.pd-welcome .pd-name { color: var(--brand); }
.pd-welcome-mascot { display: flex; align-items: center; justify-content: center; }

.pd-status-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pd-status-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem; border-radius: 99px;
  font-size: .8rem; font-weight: 800;
  text-decoration: none;
}
.pd-pin-on { background: var(--gray-100); color: var(--gray-600); }
.pd-pin-off { background: var(--amber-lt); color: #92400e; border: 1px dashed #FCD34D; }
.pd-pin-off:hover { text-decoration: none; background: #FDE68A; }
.pd-active { background: var(--green-lt); color: #065f46; }
.pd-trial { background: var(--brand-lt); color: var(--brand-dk); }
.pd-inactive { background: var(--gray-100); color: var(--gray-600); }

/* Subscribe card — soft brand purple, matches the rest of the page */
.pd-sub-card {
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  border: 2px solid #C4B5FD;
}
.pd-sub-head h2 {
  font-size: 1.3rem; font-weight: 900;
  color: var(--brand-dk); margin: 0 0 .25rem;
}
.pd-sub-head p { color: var(--gray-600); font-size: .92rem; margin-bottom: 1.25rem; }

.pd-sub-form { display: flex; flex-direction: column; gap: .75rem; }

.pd-plan-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
}
.pd-plan-tab {
  background: white;
  border: 2px solid transparent;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  transition: all .15s ease;
}
.pd-plan-tab:hover { border-color: var(--brand); transform: translateY(-1px); }
.pd-plan-tab-active {
  background: var(--brand);
  color: white;
  border-color: var(--brand-dk);
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.pd-plan-name {
  font-size: .82rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em;
  color: var(--gray-600);
  display: flex; align-items: center; gap: .4rem;
}
.pd-plan-tab-active .pd-plan-name { color: white; }
.pd-plan-price {
  font-size: 1.4rem; font-weight: 900;
  color: var(--gray-800);
  letter-spacing: -.02em;
}
.pd-plan-price small { font-size: .82rem; font-weight: 700; opacity: .7; }
.pd-plan-tab-active .pd-plan-price { color: white; }
.pd-save-badge {
  background: var(--amber);
  color: white;
  font-size: .65rem;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-weight: 900;
  letter-spacing: .03em;
}
.pd-plan-tab-active .pd-save-badge { background: white; color: var(--brand-dk); }

.pd-subscribe-btn { margin-top: .25rem; }
.pd-guarantee {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: var(--gray-600); font-weight: 700;
  margin: 0;
}

.pd-promo-row {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px dashed rgba(124,58,237,.25);
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.pd-promo-label { font-size: .85rem; font-weight: 700; color: var(--brand-dk); }
.pd-promo-form { display: flex; gap: .5rem; flex: 1; min-width: 220px; }
.pd-promo-input {
  flex: 1;
  padding: .5rem .85rem;
  border-radius: 99px;
  border: 1.5px solid rgba(124,58,237,.25);
  font-family: inherit;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255,255,255,.6);
}
.pd-promo-input:focus { outline: none; border-color: var(--brand); background: white; }

/* Section headers */
.pd-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.pd-section-head h2 {
  font-size: 1.4rem; font-weight: 900;
  color: var(--gray-800); margin: 0;
  letter-spacing: -.015em;
}
.pd-section-count {
  font-size: .82rem; font-weight: 800;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: .25rem .75rem; border-radius: 99px;
}

/* Students */
.pd-students { margin-bottom: 1.75rem; }
.pd-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.pd-student-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; align-items: center;
}
.pd-student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pd-avatar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  margin-bottom: .75rem;
}
.pd-avatar-emoji {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(124,58,237,.15);
}
.pd-avatar-name {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pd-student-card h3 { font-size: 1.1rem; font-weight: 900; margin: 0 .5rem; color: var(--gray-800); }
.pd-student-grade { font-size: .85rem; color: var(--gray-600); font-weight: 700; margin-bottom: .75rem; }
.pd-student-metrics { display: flex; gap: .35rem; margin-bottom: .85rem; }
.pd-skill-btn { margin-top: auto; }

/* Add student card */
.pd-add-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  border: 2px dashed var(--brand-lt);
}
.pd-add-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.pd-add-head h2 {
  font-size: 1.3rem; font-weight: 900;
  margin: 0; color: var(--gray-800);
  letter-spacing: -.015em;
}
.pd-add-sub { color: var(--gray-600); font-size: .9rem; margin-top: .15rem; }

.pd-add-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.pd-add-form label {
  display: block;
  font-size: .8rem;
  font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.pd-add-name input {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
}
.pd-add-name input:focus { outline: none; border-color: var(--brand); background: var(--brand-lt); }

/* Grade pills */
.pd-grade-pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pd-grade-pill {
  background: var(--gray-100);
  border: 2px solid transparent;
  color: var(--gray-600);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  display: flex; align-items: center; justify-content: center;
}
.pd-grade-pill:hover { background: var(--brand-lt); color: var(--brand-dk); transform: scale(1.05); }
.pd-grade-pill-active {
  background: var(--brand);
  color: white;
  border-color: var(--brand-dk);
  box-shadow: 0 4px 10px rgba(124,58,237,.3);
  transform: scale(1.05);
}
/* Color-cycle the pills for visual interest */
.pd-grade-pill:nth-child(1) { background: #FEF3C7; color: #92400e; }
.pd-grade-pill:nth-child(2) { background: #DBEAFE; color: #1E40AF; }
.pd-grade-pill:nth-child(3) { background: #D1FAE5; color: #065F46; }
.pd-grade-pill:nth-child(4) { background: #EDE9FE; color: var(--brand-dk); }
.pd-grade-pill:nth-child(5) { background: #FCE7F3; color: var(--pink); }
.pd-grade-pill:nth-child(6) { background: #FFE4E6; color: #BE123C; }
.pd-grade-pill:nth-child(7) { background: #CFFAFE; color: var(--cyan); }
.pd-grade-pill-active {
  background: var(--brand) !important;
  color: white !important;
}

.pd-add-submit { justify-self: start; padding-left: 2.5rem; padding-right: 2.5rem; }

/* Mobile */
@media (max-width: 640px) {
  .pd-welcome { grid-template-columns: 1fr; text-align: center; }
  .pd-welcome-mascot { order: -1; }
  .pd-status-row { justify-content: center; }
  .pd-plan-toggle { grid-template-columns: 1fr; }
  .pd-add-head { flex-direction: column; text-align: center; }
}

/* Manage subscription pill (button styled as a status pill) */
.pd-manage {
  background: white;
  color: var(--brand-dk);
  border: 1.5px solid var(--brand-lt);
  cursor: pointer;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 800;
  padding: .35rem .85rem;
  border-radius: 99px;
  transition: all .15s ease;
}
.pd-manage:hover { background: var(--brand-lt); color: var(--brand-dk); border-color: var(--brand); }

/* Billing notice when adding a student under an active sub */
.pd-billing-notice {
  background: var(--amber-lt);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .88rem;
  color: #92400e;
  line-height: 1.5;
}
.pd-billing-notice strong { font-weight: 900; }

/* Mastered badge inline with mastery bar label */
.mastered-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--green-lt);
  color: #065f46;
  font-size: .7rem;
  font-weight: 900;
  padding: .15rem .55rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: .5rem;
  vertical-align: middle;
}

/* Student-card delete button (small X in the top-right corner) */
.pd-student-card { position: relative; }
.pd-delete-form {
  position: absolute;
  top: .5rem;
  right: .5rem;
  margin: 0;
}
.pd-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  opacity: .6;
}
.pd-student-card:hover .pd-delete-btn { opacity: 1; }
.pd-delete-btn:hover {
  background: var(--red-lt);
  color: var(--red);
  transform: scale(1.1);
}

/* ────────────────────────────────────────────────────────────────────
   Responsive — comprehensive tablet + mobile rules
   ──────────────────────────────────────────────────────────────────── */

/* ── Tablet (641px – 1024px) ── */
@media (max-width: 1024px) {
  .main-content { padding: 1.5rem .85rem 4rem; }

  /* Landing pages — tighter hero */
  .lp-hero h1, .lp-how-hero h1 { font-size: 2.4rem; }
  .lp-hero { gap: 2rem; }
  .lp-feat-grid, .lp-how-steps { grid-template-columns: repeat(2, 1fr); }
  .lp-faq-grid { grid-template-columns: repeat(2, 1fr); }

  /* Pricing — keep 2 cols but tighter */
  .lp-price-cards { gap: 1rem; }

  /* Admin */
  .admin-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; gap: 1rem; }

  /* Parent dashboard */
  .pd-student-grid { grid-template-columns: repeat(2, 1fr); }

  /* Skill tree */
  .cluster-world { padding: 1rem; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  .main-content { padding: 1rem .75rem 3rem; }

  /* Navbar — tighter, drop the explanatory links, keep the essentials */
  .navbar { padding: 0 .85rem; }
  .nav-brand { font-size: 1.05rem; gap: .35rem; }
  .nav-brand .icon { width: 18px !important; height: 18px !important; }
  .nav-links { gap: .5rem; }
  .nav-links a { font-size: .82rem; padding: .25rem .4rem; }
  .nav-links a[href*="how-it-works"] { display: none; }  /* save space */
  .nav-cta { padding: .35rem .8rem; font-size: .8rem; }
  .nav-student-btn { padding: .25rem .65rem; font-size: .78rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-admin { padding: .25rem .55rem !important; font-size: .78rem !important; }

  /* Bigger touch targets across all buttons */
  .btn { min-height: 44px; padding: .65rem 1.1rem; }
  .btn-sm { min-height: 38px; padding: .45rem .85rem; }
  .btn-lg { min-height: 50px; }

  /* Headings shrink */
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.25rem !important; }
  .lp-section-title { font-size: 1.5rem !important; }
  .lp-hero h1, .lp-how-hero h1 { font-size: 1.85rem !important; line-height: 1.15; }
  .lp-pricing-head h1 { font-size: 1.7rem !important; }
  .lp-final-cta h2 { font-size: 1.5rem !important; }
  .pd-welcome h1 { font-size: 1.45rem !important; }

  /* Landing page */
  .lp-hero, .lp-how-hero { grid-template-columns: 1fr; text-align: center; gap: 1rem; padding: 1.5rem 0; }
  .lp-hero-mascot, .lp-how-hero > div:last-child { display: flex; justify-content: center; }
  .lp-mascot-bubble { display: none; }
  .lp-cta-row { flex-direction: column; gap: .5rem; }
  .lp-cta-row .btn { width: 100%; }
  .lp-trust { flex-direction: column; gap: .5rem; padding: 1rem; }
  .lp-trust-item { flex-direction: row; gap: .75rem; min-width: 0; }
  .lp-feat-grid, .lp-how-steps, .lp-faq-grid, .lp-science-grid { grid-template-columns: 1fr; }

  /* Try-a-question demo */
  .lp-demo-card { padding: 1.25rem; }
  .lp-demo-question { font-size: 1.2rem; }
  .lp-demo-choices { grid-template-columns: 1fr; }
  .lp-grade-picker { gap: .3rem; }
  .lp-grade-btn { font-size: .75rem; padding: .35rem .7rem; }

  /* Pricing cards */
  .lp-price-cards { grid-template-columns: 1fr; gap: 1rem; }
  .lp-price-featured { transform: none; }
  .lp-price-amount { font-size: 2.1rem; }
  .lp-pricing-table { padding: 1rem; }
  .lp-pricing-table td, .lp-pricing-table th { padding: .5rem .4rem; font-size: .82rem; }

  /* Auth pages */
  .auth-container { padding-top: 1.5rem; padding-left: .75rem; padding-right: .75rem; }
  .auth-card { padding: 1.5rem 1.25rem; }

  /* Parent dashboard */
  .pd-welcome { grid-template-columns: 1fr; text-align: center; padding: 1.25rem; gap: 1rem; }
  .pd-welcome-mascot { order: -1; }
  .pd-welcome-mascot svg { width: 80px !important; height: 80px !important; }
  .pd-status-row { justify-content: center; }
  .pd-sub-card { padding: 1.25rem; }
  .pd-plan-toggle { grid-template-columns: 1fr; }
  .pd-plan-tab { padding: .75rem .85rem; }
  .pd-promo-row { flex-direction: column; align-items: stretch; gap: .5rem; }
  .pd-promo-form { width: 100%; }
  .pd-student-grid { grid-template-columns: 1fr; }
  .pd-student-card { padding: 1.25rem 1rem; }
  .pd-add-card { padding: 1.25rem; }
  .pd-add-head { flex-direction: column; text-align: center; gap: .5rem; }
  .pd-add-head h2 { font-size: 1.15rem !important; }
  .pd-add-mascot svg { width: 50px !important; height: 50px !important; }
  .pd-grade-pills { justify-content: center; }
  .pd-grade-pill { width: 42px; height: 42px; }   /* still ≥40px touch target */
  .pd-add-submit { width: 100%; padding-left: 1rem; padding-right: 1rem; }
  .pd-billing-notice { font-size: .82rem; }

  /* Practice page */
  .practice-container { padding: .75rem; }
  /* Mobile: keep practice-top compressed so the whole sticky group (title +
     stats + progress bar + milestone) doesn't eat the viewport. */
  .practice-sticky-header { padding: .35rem .25rem .25rem; }
  .practice-sticky-header .mastery-bar-milestone { font-size: .66rem; }
  .practice-top { flex-direction: row; align-items: center; gap: .5rem; padding: .25rem 0; margin-bottom: .35rem; }
  .skill-title-row { flex: 1 1 auto; flex-wrap: nowrap; gap: .35rem; min-width: 0; }
  .skill-title-row h1 { font-size: .95rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .practice-avatar-mini { width: 28px !important; height: 28px !important; flex-shrink: 0; }
  .skill-code-badge { font-size: .65rem; padding: .15rem .4rem; flex-shrink: 0; }
  .practice-stats-bar { width: 100%; justify-content: space-between; }
  .question-card { padding: 1.25rem 1rem; }
  .question-text { font-size: 1.05rem; }
  .audio-btn-row { flex-wrap: wrap; gap: .35rem; }
  .audio-btn { font-size: .75rem; padding: .3rem .65rem; }
  .choices { gap: .5rem; }
  .choice-btn { padding: .85rem .75rem; min-height: 50px; font-size: .95rem; }
  .choice-letter { font-size: .9rem; }
  .next-btn, #next-btn { width: 100%; }
  .feedback-area .btn { width: 100%; }

  /* Hint — match desktop pill layout (Read Aloud parity) */
  .hint-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem; }
  .pencil-tip { font-size: .7rem; }
  .hint-btn { font-size: .75rem; padding: .3rem .65rem; }

  /* Mastery bar */
  .mastery-bar-label { font-size: .8rem; }
  .mastered-badge { font-size: .65rem; padding: .1rem .4rem; }

  /* Daily limit / mastery / daily-limit cards */
  .daily-limit-card, .mastery-modal-box, .daily-results-box { padding: 1.5rem 1rem; }

  /* Skill tree */
  .skill-tree-container { padding: .5rem; }
  .skill-tree-header { padding: 1rem; }
  .skill-tree-header h1 { font-size: 1.4rem !important; }
  .skill-tree-avatar-row { flex-direction: column; text-align: center; gap: .75rem; }
  .skill-tree-top-bar { grid-template-columns: 1fr; gap: .75rem; padding: 1rem; }
  .top-stat { padding: .5rem; }
  .domain-title { font-size: 1.15rem; padding: .5rem; }
  .cluster-world-header { flex-direction: column; align-items: stretch; text-align: center; gap: .65rem; }
  .cluster-header-right { justify-content: center; }
  .skill-path { overflow-x: auto; padding: .85rem .65rem; }
  .skill-node { width: 52px; height: 52px; }
  .skill-label { font-size: .68rem; max-width: 60px; }

  /* Daily challenge */
  .daily-container { padding: .75rem; }
  .daily-header { flex-direction: column; text-align: center; gap: .75rem; }
  .daily-progress-bar-wrap { padding: .85rem 1rem; }

  /* Avatar select — 2 cols on tiny phones, 3 on slightly bigger */
  .avatar-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .avatar-card { padding: .85rem .5rem; }
  .avatar-emoji { font-size: 2.4rem; }

  /* Admin */
  .admin-container { padding: 1rem .75rem 3rem; }
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .kpi-card { padding: .85rem; }
  .kpi-value { font-size: 1.4rem; }
  .admin-table { font-size: .82rem; }
  .admin-table td, .admin-table th { padding: .4rem .35rem; }
  .period-btn { font-size: .75rem; padding: .3rem .65rem; }

  /* Site footer */
  .site-footer { gap: .85rem; padding: 1.25rem .85rem; flex-direction: column; }

  /* Flash messages — fit within viewport */
  .flash-container { padding: 0 .75rem; }
  .flash { font-size: .88rem; padding: .65rem .85rem; }
}

/* ── Very small phones (≤ 380px) — extra tightening ── */
@media (max-width: 380px) {
  .nav-brand { font-size: .95rem; }
  .nav-links a:not(.nav-cta) { display: none; }   /* keep only logo + Start Free / Log out */
  h1 { font-size: 1.4rem !important; }
  .lp-hero h1, .lp-how-hero h1 { font-size: 1.6rem !important; }
  .pd-welcome h1 { font-size: 1.3rem !important; }
  .choice-btn { font-size: .9rem; padding: .75rem .6rem; }
}

/* ── Reduce-motion respect (accessibility) ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .runner-track, .runner-char { animation: none !important; }
}

/* ────────────────────────────────────────────────────────────────────
   Student Progress (sp-) — parent-facing analytics
   ──────────────────────────────────────────────────────────────────── */

.sp-back {
  display: inline-block;
  font-size: .82rem;
  color: var(--brand-dk);
  font-weight: 800;
  margin-bottom: .85rem;
  text-decoration: none;
}
.sp-back:hover { text-decoration: underline; }

.sp-header {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  border: 2px solid var(--brand-lt);
}
.sp-header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}
.sp-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(124,58,237,.15);
}
.sp-header-text h1 {
  font-size: 1.6rem; font-weight: 900; margin: 0;
  letter-spacing: -.015em;
  color: var(--gray-800);
}
.sp-header-sub { font-size: .9rem; color: var(--gray-600); margin-top: .15rem; font-weight: 700; }
.sp-header-mascot { display: flex; align-items: center; }

/* KPI cards */
.sp-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.sp-kpi {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--brand);
  position: relative;
}
.sp-kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-lt);
  color: var(--brand-dk);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .65rem;
}
.sp-kpi-value {
  font-size: 1.85rem; font-weight: 900;
  color: var(--gray-800);
  letter-spacing: -.02em;
  line-height: 1;
}
.sp-kpi-value small { font-size: .92rem; font-weight: 700; color: var(--gray-400); }
.sp-kpi-label {
  margin-top: .35rem;
  font-size: .8rem; font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sp-kpi-label small { font-weight: 700; opacity: .65; text-transform: none; letter-spacing: 0; }
.sp-kpi-delta {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--green-lt); color: #065f46;
  font-size: .7rem; font-weight: 900;
  padding: .15rem .55rem; border-radius: 99px;
}
.sp-kpi-purple { border-top-color: var(--brand); }
.sp-kpi-purple .sp-kpi-icon { background: var(--brand-lt); color: var(--brand-dk); }
.sp-kpi-amber  { border-top-color: var(--amber); }
.sp-kpi-amber  .sp-kpi-icon { background: var(--amber-lt); color: #92400e; }
.sp-kpi-green  { border-top-color: var(--green); }
.sp-kpi-green  .sp-kpi-icon { background: var(--green-lt); color: #065f46; }
.sp-kpi-cyan   { border-top-color: var(--cyan); }
.sp-kpi-cyan   .sp-kpi-icon { background: #CFFAFE; color: var(--cyan); }

/* Generic "section card" */
.sp-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.sp-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1rem;
}
.sp-card-head h2 {
  font-size: 1.15rem; font-weight: 900; margin: 0;
  color: var(--gray-800);
  letter-spacing: -.015em;
}
.sp-card-sub { font-size: .82rem; color: var(--gray-500); font-weight: 700; }
.sp-empty { color: var(--gray-400); font-size: .9rem; font-weight: 600; font-style: italic; }

/* Heatmap — 30-day grid (5 rows × 6 cols) */
.sp-heatmap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-width: 360px;
  margin: 0 auto;
}
.sp-heat {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--gray-100);
  cursor: default;
  transition: transform .15s ease;
}
.sp-heat:hover { transform: scale(1.15); z-index: 2; }
.sp-heat-0 { background: var(--gray-100); }
.sp-heat-1 { background: #DDD6FE; }
.sp-heat-2 { background: #A78BFA; }
.sp-heat-3 { background: #7C3AED; }
.sp-heat-4 { background: #5B21B6; }

.sp-heat-legend {
  display: flex; align-items: center; justify-content: center;
  gap: .35rem; margin-top: .85rem;
  font-size: .72rem; color: var(--gray-500); font-weight: 700;
}
.sp-heat-legend .sp-heat { width: 14px; height: 14px; aspect-ratio: auto; }

/* Per-domain mastery bars */
.sp-domain-list { display: flex; flex-direction: column; gap: .85rem; }
.sp-domain-row { display: flex; flex-direction: column; gap: .35rem; }
.sp-domain-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .88rem; font-weight: 800;
}
.sp-domain-name { color: var(--gray-800); }
.sp-domain-count { color: var(--gray-500); font-weight: 700; font-size: .82rem; }
.sp-domain-track {
  height: 10px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}
.sp-domain-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, #A78BFA 100%);
  border-radius: 99px;
  transition: width .3s ease;
}

/* Two-column section for top + struggling */
.sp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.sp-two-col .sp-card { margin-bottom: 0; }

/* Skill list */
.sp-skill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.sp-skill-list li {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .88rem;
}
.sp-skill-code {
  background: var(--brand);
  color: white;
  font-size: .72rem;
  font-weight: 900;
  padding: .15rem .45rem;
  border-radius: 5px;
  flex-shrink: 0;
}
.sp-skill-name { flex: 1; color: var(--gray-800); font-weight: 700; }
.sp-skill-stars { display: flex; gap: 1px; color: var(--star); }
.sp-skill-pct {
  font-size: .78rem; font-weight: 900;
  color: var(--red);
  background: var(--red-lt);
  padding: .15rem .5rem;
  border-radius: 99px;
}

.sp-cta-row { text-align: center; margin: 1.5rem 0 1rem; }

/* Dashboard card actions row */
.pd-card-actions { display: flex; gap: .4rem; margin-top: auto; flex-wrap: wrap; justify-content: center; }
.pd-card-actions .btn { flex: 1; min-width: 0; }

/* Mobile */
@media (max-width: 640px) {
  .sp-header-row { grid-template-columns: 1fr; text-align: center; gap: .75rem; }
  .sp-avatar { margin: 0 auto; }
  .sp-header-mascot { display: none; }
  .sp-kpis { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .sp-kpi { padding: 1rem .85rem; }
  .sp-kpi-value { font-size: 1.5rem; }
  .sp-card { padding: 1.25rem; }
  .sp-heatmap { gap: 4px; max-width: 280px; }
  .sp-two-col { grid-template-columns: 1fr; }
  .pd-card-actions { flex-direction: column; }
  .pd-card-actions .btn { width: 100%; }
}

/* ────────────────────────────────────────────────────────────────────
   First-time onboarding hero (zero students, not subscribed)
   ──────────────────────────────────────────────────────────────────── */
.pd-onboard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 50%, #DDD6FE 100%);
  border: 2px solid var(--brand-lt);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.pd-onboard::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(252,211,77,.25), transparent 70%);
  pointer-events: none;
}
.pd-onboard-mascot { display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.pd-onboard-text { position: relative; z-index: 1; }
.pd-onboard-eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  background: white;
  color: var(--brand-dk);
  font-size: .72rem;
  font-weight: 900;
  padding: .3rem .75rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
  box-shadow: var(--shadow);
}
.pd-onboard-text h2 {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--gray-800);
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  line-height: 1.2;
}
.pd-onboard-text p {
  color: var(--gray-600);
  font-size: .95rem;
  line-height: 1.5;
  margin: 0;
}
.pd-onboard-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-top: .5rem;
  position: relative;
  z-index: 1;
}
.pd-onboard-form label {
  display: block;
  font-size: .8rem;
  font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.pd-onboard-form input[type="text"] {
  width: 100%;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}
.pd-onboard-form input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--brand-lt);
}
.pd-onboard-cta {
  width: 100%;
  font-size: 1.05rem;
}
.pd-onboard-foot {
  text-align: center;
  font-size: .85rem;
  color: var(--gray-500);
  margin: 0 0 1rem;
}
.pd-onboard-foot a { color: var(--brand-dk); font-weight: 800; }

/* Collapsed promo/subscribe option */
.pd-sub-collapse {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 1rem;
}
.pd-sub-collapse summary {
  cursor: pointer;
  padding: .85rem 1.25rem;
  font-weight: 800;
  font-size: .88rem;
  color: var(--gray-600);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pd-sub-collapse summary::-webkit-details-marker { display: none; }
.pd-sub-collapse summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-400);
  transition: transform .2s ease;
}
.pd-sub-collapse[open] summary::after { content: "−"; }
.pd-sub-collapse-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
}

@media (max-width: 640px) {
  .pd-onboard { grid-template-columns: 1fr; text-align: center; padding: 1.5rem 1.25rem; gap: 1rem; }
  .pd-onboard-mascot svg { width: 100px !important; height: 100px !important; }
  .pd-onboard-text h2 { font-size: 1.3rem; }
  .pd-onboard-form { padding: 1.25rem; }
  .pd-grade-pills { justify-content: center; }
}

/* Tiny collapsed promo affordance inside the subscribe card */
.pd-promo-mini {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px dashed rgba(124,58,237,.22);
}
.pd-promo-mini summary {
  cursor: pointer;
  list-style: none;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-dk);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem 0;
}
.pd-promo-mini summary::-webkit-details-marker { display: none; }
.pd-promo-mini summary::before {
  content: "+";
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-lt);
  color: var(--brand-dk);
  font-weight: 900;
  font-size: .85rem;
  line-height: 1;
}
.pd-promo-mini[open] summary::before { content: "−"; }
.pd-promo-mini summary:hover { color: var(--brand); }
.pd-promo-mini .pd-promo-form {
  display: flex; gap: .5rem; margin-top: .65rem;
  max-width: 360px;
}

/* Forgot-PIN affordance on the pin lock screen */
.pin-forgot-link {
  display: inline-block;
  margin-top: 1rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 800;
  color: var(--brand-dk);
  text-decoration: underline;
  cursor: pointer;
}
.pin-forgot-link:hover { color: var(--brand); }
.pin-forgot-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--brand-lt);
  border-radius: var(--radius-sm);
  text-align: left;
}
.pin-forgot-msg {
  font-size: .82rem;
  color: var(--gray-600);
  font-weight: 700;
  margin-bottom: .65rem;
}
.pin-forgot-form input[type="password"] {
  width: 100%;
  padding: .55rem .85rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  margin-bottom: .65rem;
}
.pin-forgot-form input[type="password"]:focus { outline: none; border-color: var(--brand); }
.pin-forgot-actions { display: flex; gap: .5rem; }
.pin-forgot-actions .btn { flex: 1; }
.pin-forgot-error {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--red);
  font-weight: 700;
}

/* Avatar select: locked-state visual + level pill */
.avatar-select-level {
  display: inline-block;
  margin-top: .35rem;
  background: var(--brand-lt);
  color: var(--brand-dk);
  padding: .25rem .85rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 800;
}
.avatar-card-locked {
  opacity: .5;
  cursor: not-allowed !important;
  filter: grayscale(.7);
}
.avatar-card-locked:hover { transform: none !important; box-shadow: var(--shadow) !important; }
.avatar-emoji-wrap { position: relative; }
.avatar-lock-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--gray-600);
  border: 2px solid white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-unlock-hint {
  color: var(--brand-dk) !important;
  font-weight: 800;
}

/* Avatar-unlock celebration modal (matches mastery-modal style) */
.avatar-unlock-modal {
  position: fixed; inset: 0;
  background: rgba(15,15,30,.55);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .25s ease;
}
.avatar-unlock-box {
  background: white;
  border-radius: var(--radius);
  padding: 2rem 1.75rem 1.75rem;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: pop .35s cubic-bezier(.5,1.6,.6,1);
}
.avatar-unlock-confetti { font-size: 2.4rem; margin-bottom: .35rem; }
.avatar-unlock-box h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brand-dk);
  margin: 0 0 1rem;
  letter-spacing: -.02em;
}
.avatar-unlock-bubble {
  width: 110px; height: 110px;
  border-radius: 50%;
  margin: 0 auto .85rem;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid white;
  box-shadow: 0 8px 24px rgba(124,58,237,.25);
  background: var(--brand-lt);
}
.avatar-unlock-emoji { font-size: 3.5rem; line-height: 1; }
.avatar-unlock-name { font-size: 1.15rem; font-weight: 900; margin: 0 0 .25rem; }
.avatar-unlock-sub  { font-size: .88rem; color: var(--gray-600); margin: 0 0 1.25rem; }
.avatar-unlock-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.avatar-unlock-actions .btn { min-width: 130px; }

@keyframes pop {
  0%   { transform: scale(.7); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}
@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
