/* ===================================================
   AI EXPLORERS ACADEMY — MASTER STYLESHEET
   =================================================== */

/* --- CSS Variables --- */
:root {
  --navy:    #0A1628;
  --navy2:   #0F2040;
  --navy3:   #162B50;
  --blue:    #1A8FE3;
  --blue2:   #0D6EBD;
  --blue3:   #4DB8FF;
  --green:   #22C78A;
  --green2:  #16A370;
  --yellow:  #FFD23F;
  --yellow2: #FFC107;
  --purple:  #A855F7;
  --purple2: #7C3AED;
  --pink:    #F472B6;
  --orange:  #FB923C;
  --red:     #EF4444;
  --white:   #FFFFFF;
  --gray1:   #E2E8F0;
  --gray2:   #94A3B8;
  --gray3:   #475569;
  --text:    #F0F6FF;
  --card-bg: rgba(255,255,255,0.07);
  --card-border: rgba(255,255,255,0.12);
  --radius:  16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow:  0 8px 32px rgba(0,0,0,0.35);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.25);
  --font:    'Nunito', sans-serif;
  --font-brand: 'Orbitron', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; height: 100%; }

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
a { color: var(--blue3); text-decoration: none; }

/* --- Boot Screen --- */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 40%, #162B50 0%, #0A1628 70%);
  gap: 16px;
}

.boot-logo {
  font-size: 72px;
  animation: pulse-float 2s ease-in-out infinite;
}
.boot-logo-img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  animation: pulse-float 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(77,184,255,0.5));
}

.boot-title {
  font-family: var(--font-brand);
  font-size: clamp(20px, 5vw, 32px);
  color: var(--blue3);
  letter-spacing: 2px;
  text-align: center;
}

.boot-bar {
  width: 200px;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.boot-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 99px;
  animation: boot-load 1.5s ease-in-out forwards;
}

@keyframes boot-load {
  from { width: 0; }
  to   { width: 100%; }
}

/* --- Screen Wrapper --- */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* --- Starfield Background --- */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: var(--op, 0.6); transform: scale(1.4); }
}

/* --- Gradient Backgrounds --- */
.bg-navy-gradient {
  background: radial-gradient(ellipse at 30% 20%, #162B50 0%, #0A1628 60%);
}

.bg-mission {
  background: linear-gradient(135deg, #0A1628 0%, #0F2040 50%, #0A1628 100%);
}

/* --- Top Navigation Bar --- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(10,22,40,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left { display: flex; align-items: center; gap: 10px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blue3);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(77,184,255,0.1);
  transition: var(--transition);
}
.back-btn:hover { background: rgba(77,184,255,0.2); }

.top-logo {
  font-family: var(--font-brand);
  font-size: 13px;
  color: var(--blue3);
  letter-spacing: 1px;
}

.xp-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,210,63,0.15);
  border: 1px solid rgba(255,210,63,0.3);
  color: var(--yellow);
  font-weight: 800;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 20px;
}

/* --- Welcome Screen --- */
.welcome-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1A3A6B 0%, #0A1628 65%);
  padding: 40px 24px;
  text-align: center;
  position: relative;
}

.welcome-logo {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin-bottom: 8px;
  animation: pulse-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(77,184,255,0.55));
}
.welcome-planet {
  font-size: 100px;
  margin-bottom: 8px;
  animation: pulse-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(26,143,227,0.5));
}

.welcome-brand {
  font-family: var(--font-brand);
  font-size: clamp(22px, 6vw, 42px);
  background: linear-gradient(135deg, var(--blue3), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.welcome-tagline {
  font-size: 16px;
  color: var(--gray2);
  margin-bottom: 40px;
  max-width: 340px;
  line-height: 1.6;
}

.welcome-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  font-size: 17px;
  font-weight: 800;
  padding: 16px 32px;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(26,143,227,0.4);
  letter-spacing: 0.5px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26,143,227,0.55);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--card-bg);
  color: var(--blue3);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  transition: var(--transition);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-ghost {
  color: var(--gray2);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  transition: var(--transition);
}
.btn-ghost:hover { color: var(--text); background: var(--card-bg); }

.welcome-badges-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.mini-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray1);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Role Selection --- */
.role-screen {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 20%, #162B50, #0A1628 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
}

.screen-title {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 900;
  text-align: center;
  margin-bottom: 8px;
  color: var(--white);
}

.screen-subtitle {
  font-size: 15px;
  color: var(--gray2);
  text-align: center;
  margin-bottom: 36px;
  max-width: 380px;
  line-height: 1.6;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.role-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.role-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
}

.role-card.selected {
  border-color: var(--blue);
  background: rgba(26,143,227,0.15);
  box-shadow: 0 0 0 2px var(--blue), var(--shadow);
}

.role-icon { font-size: 48px; }
.role-label { font-size: 15px; font-weight: 800; color: var(--white); }
.role-desc { font-size: 12px; color: var(--gray2); line-height: 1.5; }

/* --- Grade Band --- */
.grade-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 480px;
}

.grade-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 20px;
}
.grade-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.3);
  box-shadow: var(--shadow);
}
.grade-icon { font-size: 52px; }
.grade-info { flex: 1; }
.grade-label { font-size: 20px; font-weight: 900; color: var(--white); margin-bottom: 4px; }
.grade-desc { font-size: 13px; color: var(--gray2); line-height: 1.5; }

.grade-card.grades-2-5 { border-color: rgba(34,199,138,0.3); }
.grade-card.grades-2-5:hover { border-color: var(--green); box-shadow: 0 8px 32px rgba(34,199,138,0.2); }
.grade-card.grades-6-8 { border-color: rgba(168,85,247,0.3); }
.grade-card.grades-6-8:hover { border-color: var(--purple); box-shadow: 0 8px 32px rgba(168,85,247,0.2); }

/* --- Avatar Setup --- */
.avatar-screen {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 20%, #162B50, #0A1628 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 60px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 28px;
}

.avatar-option {
  aspect-ratio: 1;
  border-radius: var(--radius);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  cursor: pointer;
  transition: var(--transition);
}
.avatar-option:hover {
  transform: scale(1.1);
  border-color: var(--blue3);
}
.avatar-option.selected {
  border-color: var(--yellow);
  background: rgba(255,210,63,0.15);
  box-shadow: 0 0 0 3px rgba(255,210,63,0.4);
  transform: scale(1.08);
}

.nickname-input {
  width: 100%;
  max-width: 320px;
  padding: 14px 20px;
  border-radius: 50px;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  outline: none;
  transition: var(--transition);
}
.nickname-input:focus { border-color: var(--blue3); box-shadow: 0 0 0 3px rgba(77,184,255,0.2); }
.nickname-input::placeholder { color: var(--gray3); }

.difficulty-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.diff-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--gray2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.diff-btn:hover { border-color: var(--blue3); color: var(--white); }
.diff-btn.active { border-color: var(--blue); background: rgba(26,143,227,0.2); color: var(--blue3); }

/* --- Mission Map --- */
.mission-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A1628 0%, #0F2040 50%, #0A1628 100%);
}

.mission-header {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid var(--blue3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.student-name { font-size: 18px; font-weight: 800; }
.student-band { font-size: 12px; color: var(--gray2); }

.xp-bar-container { flex: 1; }
.xp-label { font-size: 11px; color: var(--gray2); margin-bottom: 4px; display: flex; justify-content: space-between; }
.xp-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 99px; transition: width 0.8s ease; }

.mission-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
}

.mission-main-title { font-size: 20px; font-weight: 900; }
.mission-streak {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,107,0,0.15);
  border: 1px solid rgba(255,107,0,0.3);
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
}

.mission-path {
  padding: 0 20px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.mission-connector {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, var(--card-border), transparent);
  margin: -8px 0;
}

.day-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.day-card.completed {
  background: rgba(34,199,138,0.1);
  border: 1.5px solid rgba(34,199,138,0.3);
}
.day-card.active {
  background: linear-gradient(135deg, rgba(26,143,227,0.2), rgba(77,184,255,0.1));
  border: 2px solid var(--blue);
  box-shadow: 0 0 30px rgba(26,143,227,0.25), var(--shadow);
  animation: glow-pulse 2.5s ease-in-out infinite;
}
.day-card.locked {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.06);
  opacity: 0.55;
  cursor: not-allowed;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(26,143,227,0.25), var(--shadow); }
  50% { box-shadow: 0 0 40px rgba(26,143,227,0.45), var(--shadow); }
}

.day-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.day-card.completed .day-icon-circle { background: rgba(34,199,138,0.2); }
.day-card.active .day-icon-circle { background: rgba(26,143,227,0.3); }
.day-card.locked .day-icon-circle { background: rgba(255,255,255,0.06); }

.day-info { flex: 1; }
.day-num { font-size: 11px; color: var(--gray2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.day-title { font-size: 16px; font-weight: 800; color: var(--white); margin: 2px 0; }
.day-desc { font-size: 12px; color: var(--gray2); line-height: 1.4; }

.day-status {
  font-size: 22px;
  flex-shrink: 0;
}

.active-pulse {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue3);
  background: rgba(26,143,227,0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

/* --- Lesson Screen --- */
.lesson-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A1628, #0F2040);
}

.lesson-progress-bar {
  height: 5px;
  background: rgba(255,255,255,0.1);
}

.lesson-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.5s ease;
}

.lesson-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(26,143,227,0.15);
  border: 1px solid rgba(26,143,227,0.3);
  color: var(--blue3);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.lesson-content {
  padding: 24px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.lesson-day-label { font-size: 12px; color: var(--gray2); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.lesson-heading { font-size: clamp(22px, 5vw, 32px); font-weight: 900; line-height: 1.2; margin-bottom: 16px; }

.lesson-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.lesson-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--blue3);
}

.lesson-card p { font-size: 15px; line-height: 1.7; color: var(--gray1); margin-bottom: 12px; }
.lesson-card p:last-child { margin-bottom: 0; }

.lesson-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lesson-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.5;
}
.lesson-card li::before {
  content: '▸';
  color: var(--green);
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(34,199,138,0.12), rgba(26,143,227,0.08));
  border: 1px solid rgba(34,199,138,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}

.highlight-box strong { color: var(--green); font-size: 15px; }
.highlight-box p { font-size: 14px; color: var(--gray1); margin: 6px 0 0; }

.prompt-box {
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.prompt-label { font-size: 11px; font-weight: 800; color: var(--purple); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.prompt-text { font-size: 15px; color: var(--white); line-height: 1.6; font-style: italic; }

.activity-steps { counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.activity-step {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.5;
}
.activity-step::before {
  content: counter(step);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: sticky;
  bottom: 0;
  background: rgba(10,22,40,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
}

.stage-dots { display: flex; gap: 6px; }
.stage-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--card-border);
  transition: var(--transition);
}
.stage-dot.done { background: var(--green); }
.stage-dot.active { background: var(--blue); transform: scale(1.3); }

.btn-next {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(26,143,227,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-next:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,143,227,0.5); }

.btn-prev {
  color: var(--gray2);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 50px;
  transition: var(--transition);
}
.btn-prev:hover { color: var(--white); background: var(--card-bg); }

/* --- Quiz Screen --- */
.quiz-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A1628, #0F1F3D);
  display: flex;
  flex-direction: column;
}

.quiz-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-count { font-size: 14px; font-weight: 700; color: var(--gray2); }
.quiz-score-live {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,210,63,0.12);
  border: 1px solid rgba(255,210,63,0.25);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
}

.quiz-body {
  flex: 1;
  padding: 24px 20px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.quiz-q-label {
  font-size: 11px;
  color: var(--blue3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.quiz-question {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 28px;
  color: var(--white);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray1);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-option:hover:not(.selected):not(.disabled) {
  border-color: var(--blue3);
  background: rgba(77,184,255,0.1);
  transform: translateX(4px);
}

.quiz-option.correct { border-color: var(--green); background: rgba(34,199,138,0.15); color: var(--white); }
.quiz-option.correct .quiz-option-letter { background: var(--green); color: white; }
.quiz-option.wrong { border-color: var(--red); background: rgba(239,68,68,0.12); }
.quiz-option.wrong .quiz-option-letter { background: var(--red); color: white; }
.quiz-option.disabled { cursor: default; }

.quiz-feedback {
  margin-top: 20px;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slide-up 0.3s ease;
}

.quiz-feedback.correct-fb { background: rgba(34,199,138,0.12); border: 1px solid rgba(34,199,138,0.3); }
.quiz-feedback.wrong-fb { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); }

.fb-icon { font-size: 24px; flex-shrink: 0; }
.fb-text strong { font-size: 15px; font-weight: 800; display: block; margin-bottom: 4px; }
.fb-text p { font-size: 13px; color: var(--gray2); line-height: 1.5; }

/* --- Quiz Results --- */
.quiz-results {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #1A3A6B, #0A1628 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
  background: var(--card-bg);
}

.score-ring.excellent { border-color: var(--green); box-shadow: 0 0 40px rgba(34,199,138,0.4); }
.score-ring.good { border-color: var(--blue); box-shadow: 0 0 40px rgba(26,143,227,0.4); }
.score-ring.ok { border-color: var(--yellow); box-shadow: 0 0 40px rgba(255,210,63,0.3); }

.score-pct { font-size: 40px; font-weight: 900; color: var(--white); }
.score-label { font-size: 12px; color: var(--gray2); font-weight: 700; }

.score-heading { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.score-sub { font-size: 15px; color: var(--gray2); margin-bottom: 32px; }

.score-detail {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 32px;
}

.score-stat {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 24px;
}
.score-stat-n { font-size: 28px; font-weight: 900; }
.score-stat-l { font-size: 12px; color: var(--gray2); margin-top: 2px; }

/* --- Badge/Certificate Screen --- */
.badge-screen {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 25%, #1A2A4A, #0A1628 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.badge-burst {
  font-size: 90px;
  animation: badge-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
  filter: drop-shadow(0 0 30px rgba(255,210,63,0.6));
  display: block;
  margin-bottom: 16px;
}

@keyframes badge-pop {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.badge-unlocked { font-size: 12px; color: var(--yellow); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.badge-name { font-size: clamp(24px, 6vw, 36px); font-weight: 900; margin-bottom: 12px; }
.badge-desc { font-size: 15px; color: var(--gray2); max-width: 320px; margin: 0 auto 32px; line-height: 1.6; }

.confetti-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.confetti-piece {
  font-size: 24px;
  animation: confetti-fall var(--d, 1.5s) ease-out forwards var(--delay, 0s);
  opacity: 0;
}

@keyframes confetti-fall {
  0% { transform: translateY(-30px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(20px) rotate(360deg); opacity: 0; }
}

.certificate-card {
  background: linear-gradient(135deg, rgba(255,210,63,0.1), rgba(26,143,227,0.08));
  border: 2px solid rgba(255,210,63,0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 380px;
  width: 100%;
  margin: 0 auto 28px;
}

.cert-title { font-size: 12px; color: var(--yellow); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.cert-name { font-size: 22px; font-weight: 900; color: var(--white); }
.cert-text { font-size: 14px; color: var(--gray2); margin-top: 6px; line-height: 1.6; }

/* --- AI Teacher Chat --- */
.chat-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A1628, #0C1A30);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 20px;
  background: rgba(10,22,40,0.9);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(26,143,227,0.4);
}

.ai-name { font-size: 16px; font-weight: 800; }
.ai-status { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse-dot 2s infinite; }
.ai-status-dot--thinking { background: var(--yellow); animation: pulse-dot 0.6s infinite; }

@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ── Typing indicator (animated dots while ARIA generates a response) ── */
.msg-typing .msg-bubble { padding: 12px 16px; }
.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 14px;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--blue3);
  border-radius: 50%;
  animation: typing-bounce 1.1s ease-in-out infinite;
  opacity: 0.7;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

.safety-banner {
  background: rgba(255,210,63,0.08);
  border-bottom: 1px solid rgba(255,210,63,0.2);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,210,63,0.8);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: slide-up 0.25s ease;
}

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.ai { align-self: flex-start; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.msg.ai .msg-avatar {
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.ai .msg-bubble {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--gray1);
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  padding: 16px 20px;
  background: rgba(10,22,40,0.95);
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--white);
  font-size: 14px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: var(--transition);
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--blue3); }
.chat-input::placeholder { color: var(--gray3); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26,143,227,0.4);
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(26,143,227,0.5); }

.quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
}

.quick-prompt-btn {
  background: rgba(77,184,255,0.1);
  border: 1px solid rgba(77,184,255,0.2);
  color: var(--blue3);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.quick-prompt-btn:hover { background: rgba(77,184,255,0.2); }

/* --- Art Activity Screen --- */
.art-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #0A1628, #1A0A28, #0A1628);
  display: flex;
  flex-direction: column;
}

.art-content { padding: 20px; max-width: 600px; margin: 0 auto; width: 100%; }

.art-canvas-area {
  background: var(--card-bg);
  border: 1.5px dashed rgba(168,85,247,0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.art-canvas-area.has-art {
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(26,143,227,0.08));
  border-color: rgba(168,85,247,0.5);
}

.art-placeholder { font-size: 64px; margin-bottom: 12px; }
.art-placeholder-text { color: var(--gray2); font-size: 14px; }

.art-prompt-input {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--white);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  margin-bottom: 14px;
  transition: var(--transition);
  line-height: 1.5;
}
.art-prompt-input:focus { border-color: var(--purple); }
.art-prompt-input::placeholder { color: var(--gray3); }

.btn-generate {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: white;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(168,85,247,0.35);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(168,85,247,0.5); }

.generated-art-display {
  font-size: 100px;
  animation: art-appear 0.5s cubic-bezier(0.34,1.56,0.64,1);
  display: block;
}
@keyframes art-appear { from{transform:scale(0.5);opacity:0;} to{transform:scale(1);opacity:1;} }

.safety-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.safety-chip {
  background: rgba(34,199,138,0.1);
  border: 1px solid rgba(34,199,138,0.25);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── Listen / Text-to-Speech Button ─────────────────────────────────── */
.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(77,184,255,0.10);
  border: 1px solid rgba(77,184,255,0.28);
  color: var(--blue3);
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.listen-btn:hover {
  background: rgba(77,184,255,0.20);
  border-color: var(--blue3);
  transform: translateY(-1px);
}
.listen-btn[data-speaking="yes"] {
  background: rgba(255,80,80,0.15);
  border-color: rgba(255,80,80,0.5);
  color: #ff6060;
  animation: listen-pulse 1.2s ease-in-out infinite;
}
@keyframes listen-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
/* Smaller variant inside chat bubbles */
.listen-btn--chat {
  font-size: 10px;
  padding: 3px 9px;
  margin-top: 8px;
  opacity: 0.75;
}
.listen-btn--chat:hover { opacity: 1; }

/* --- Real AI Image Display --- */
.art-real-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.art-real-image {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  display: block;
  animation: art-appear 0.5s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.art-image-caption {
  font-size: 12px;
  color: var(--gray2);
  font-style: italic;
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
}

/* --- Art Loading State --- */
.art-loading-state {
  min-height: 300px;
}

.art-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.art-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(168,85,247,0.2);
  border-top-color: var(--purple);
  border-right-color: var(--blue3);
  animation: art-spin 1s linear infinite;
}

@keyframes art-spin {
  to { transform: rotate(360deg); }
}

.art-loading-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
}

.art-loading-sub {
  font-size: 13px;
  color: var(--gray2);
  line-height: 1.6;
  max-width: 260px;
}

.art-loading-prompt {
  font-size: 12px;
  color: rgba(168,85,247,0.8);
  font-style: italic;
  max-width: 280px;
  line-height: 1.5;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.art-loading-bar-track {
  width: 200px;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.art-loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--blue3));
  border-radius: 99px;
  animation: art-loading-progress 20s ease-in-out forwards;
}

@keyframes art-loading-progress {
  0%   { width: 5%; }
  30%  { width: 45%; }
  60%  { width: 70%; }
  85%  { width: 88%; }
  100% { width: 95%; }
}

/* --- Art Studio: Inspire section --- */
.art-inspire-section {
  margin-bottom: 14px;
}
.art-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.art-cat-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.art-cat-chip:hover {
  background: rgba(77,184,255,0.15);
  border-color: var(--blue3);
  color: var(--blue3);
  transform: translateY(-1px);
}
.art-cat-chip--surprise {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.35);
  color: var(--purple);
}
.art-cat-chip--surprise:hover {
  background: rgba(168,85,247,0.25);
  border-color: var(--purple);
  color: var(--white);
}

/* --- Art Studio: Style picker --- */
.art-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.art-style-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--gray2);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.art-style-chip:hover {
  background: rgba(77,184,255,0.10);
  border-color: rgba(77,184,255,0.4);
  color: var(--white);
}
.art-style-chip.active {
  background: linear-gradient(135deg, rgba(77,184,255,0.2), rgba(168,85,247,0.2));
  border-color: var(--blue3);
  color: var(--white);
  box-shadow: 0 0 8px rgba(77,184,255,0.3);
}

/* --- Art Studio: Collapsible tips --- */
.art-tips-details {
  margin-top: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.art-tips-summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--yellow);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.art-tips-summary::-webkit-details-marker { display: none; }
.art-tips-body {
  padding: 0 16px 14px;
  display: grid;
  gap: 8px;
}
.art-tip-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.art-tip-emoji {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.art-tip-row strong {
  font-size: 12px;
  color: var(--white);
}
.art-tip-row span {
  font-size: 12px;
}

/* --- Dashboard Shared --- */
.dash-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #071020, #0A1628);
}

.dash-header {
  padding: 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-title { font-size: 24px; font-weight: 900; }
.dash-role-badge {
  background: rgba(26,143,227,0.15);
  border: 1px solid rgba(26,143,227,0.3);
  color: var(--blue3);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
}

.dash-tabs {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: var(--radius);
  margin: 16px 20px;
  overflow-x: auto;
}

.dash-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray2);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
}
.dash-tab.active {
  background: var(--card-bg);
  color: var(--white);
  border: 1px solid var(--card-border);
}

.dash-body { padding: 0 20px 80px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-card-n { font-size: 32px; font-weight: 900; color: var(--white); }
.stat-card-l { font-size: 12px; color: var(--gray2); margin-top: 4px; }
.stat-card.blue { border-color: rgba(26,143,227,0.3); }
.stat-card.green { border-color: rgba(34,199,138,0.3); }
.stat-card.yellow { border-color: rgba(255,210,63,0.3); }
.stat-card.purple { border-color: rgba(168,85,247,0.3); }

.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-row {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  transition: var(--transition);
}
.student-row:hover { border-color: rgba(255,255,255,0.2); }
.student-row-info { flex: 1; }
.student-row-name { font-size: 14px; font-weight: 800; }
.student-row-sub { font-size: 12px; color: var(--gray2); }
.student-row-right { text-align: right; }
.student-row-score { font-size: 16px; font-weight: 800; color: var(--green); }

.progress-mini { margin-top: 6px; height: 5px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.progress-mini-fill { height: 100%; border-radius: 99px; }

.btn-export {
  background: rgba(34,199,138,0.1);
  border: 1px solid rgba(34,199,138,0.3);
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-export:hover { background: rgba(34,199,138,0.2); }

.class-code-display {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.class-code-label { font-size: 12px; color: var(--gray2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.class-code-value { font-family: var(--font-brand); font-size: 36px; color: var(--blue3); letter-spacing: 6px; }

.lesson-row {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.lesson-row-day { font-size: 12px; color: var(--gray2); font-weight: 700; width: 40px; flex-shrink: 0; }
.lesson-row-title { flex: 1; font-size: 14px; font-weight: 700; }
.lesson-row-lock { font-size: 18px; cursor: pointer; transition: var(--transition); }

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Settings Screen --- */
.settings-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0A1628, #071020);
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray2);
  padding: 0 20px;
  margin-bottom: 10px;
}

.settings-row {
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-row:last-child { border-bottom: 1px solid var(--card-border); }

.settings-row-label { font-size: 15px; font-weight: 700; }
.settings-row-sub { font-size: 12px; color: var(--gray2); margin-top: 2px; }

.privacy-card {
  background: rgba(34,199,138,0.07);
  border: 1px solid rgba(34,199,138,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 0 20px 20px;
}

.privacy-card-title { font-size: 15px; font-weight: 800; color: var(--green); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.privacy-card p { font-size: 13px; color: var(--gray2); line-height: 1.6; }

/* --- Floating Nav Bar (Student) --- */
.float-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,32,64,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  display: flex;
  gap: 0;
  padding: 6px 8px;
  z-index: 200;
  box-shadow: var(--shadow);
}

.float-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 60px;
}

.float-nav-item.active {
  background: linear-gradient(135deg, rgba(26,143,227,0.25), rgba(77,184,255,0.1));
}

.float-nav-icon { font-size: 20px; }
.float-nav-label { font-size: 10px; font-weight: 700; color: var(--gray2); }
.float-nav-item.active .float-nav-label { color: var(--blue3); }

/* --- Misc & Utilities --- */
.scroll-pad { padding-bottom: 100px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--gray2);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.pill-green { background: rgba(34,199,138,0.15); border: 1px solid rgba(34,199,138,0.3); color: var(--green); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pill-blue  { background: rgba(26,143,227,0.15);  border: 1px solid rgba(26,143,227,0.3);  color: var(--blue3);  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pill-yellow{ background: rgba(255,210,63,0.12);  border: 1px solid rgba(255,210,63,0.3);  color: var(--yellow); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

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

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray2);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; line-height: 1.6; }

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pulse-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.animate-in { animation: slide-up 0.35s ease forwards; }

/* --- Responsive --- */
@media (max-width: 480px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .welcome-screen { padding: 60px 40px; }
  .role-grid { gap: 20px; }
  .mission-path { padding-bottom: 120px; }
  .chat-messages { max-height: calc(100vh - 300px); }
}

@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: repeat(4, 1fr); }
  .quiz-body, .lesson-content { max-width: 640px; }
}

/* ===================================================
   LESSON WORKSPACE — Student interactive zone
   =================================================== */

.lesson-workspace {
  margin: 0 20px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--card-border);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.ws-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid var(--card-border);
  gap: 8px;
}

.ws-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.ws-tab-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray2);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.ws-tab-btn:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.ws-tab-btn.active {
  color: var(--white);
  background: rgba(26,143,227,0.18);
  border-color: rgba(26,143,227,0.4);
}

.ws-actions { display: flex; gap: 6px; }
.ws-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.ws-action-btn:hover { background: rgba(255,255,255,0.14); }

/* --- Write Panel --- */
.ws-panel { display: flex; flex-direction: column; }

.ws-textarea {
  width: 100%;
  min-height: 220px;
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  padding: 16px 18px;
  resize: none;
  outline: none;
  flex: 1;
}
.ws-textarea::placeholder { color: var(--gray3); font-style: italic; }

.ws-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ws-hint  { font-size: 11px; color: var(--blue3); font-weight: 700; }
.ws-word-count { font-size: 11px; color: var(--gray3); }

/* --- Draw Panel --- */
.ws-draw-panel { flex-direction: column; }

.draw-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}

.draw-colors {
  display: flex;
  gap: 6px;
  align-items: center;
}

.draw-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.draw-color-swatch:hover  { transform: scale(1.2); }
.draw-color-swatch.active { border-color: white; transform: scale(1.15); box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

.draw-sizes {
  display: flex;
  gap: 6px;
  align-items: center;
}

.draw-size-btn {
  border-radius: 50%;
  background: var(--gray2);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.draw-size-btn.active { border-color: white; background: white; }

.draw-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.draw-tool-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  color: var(--gray1);
  white-space: nowrap;
}
.draw-tool-btn:hover { background: rgba(255,255,255,0.14); }
.draw-tool-btn.active { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: var(--red); }

#wsCanvas {
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
  background: rgba(255,255,255,0.03);
}

/* --- Notes Panel --- */
.ws-notes-panel { padding: 16px 18px; min-height: 220px; }
.ws-notes-title  { font-size: 12px; font-weight: 700; color: var(--blue3); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }

.ws-note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ws-note-item:last-child { border-bottom: none; }

.ws-note-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--card-border);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
  font-size: 12px;
  background: transparent;
}
.ws-note-check.checked { background: var(--green); border-color: var(--green); }

.ws-note-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--gray1);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: none;
  min-height: 20px;
}
.ws-note-input::placeholder { color: var(--gray3); }

.ws-add-note-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue3);
  background: rgba(26,143,227,0.1);
  border: 1px dashed rgba(26,143,227,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}
.ws-add-note-btn:hover { background: rgba(26,143,227,0.18); }

/* --- Saved indicator --- */
.ws-saved-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

/* --- Print styles --- */
@media print {
  .top-bar, .lesson-nav, .ws-tab-bar, .float-nav { display: none !important; }
  .lesson-screen { background: white !important; color: black !important; }
  .lesson-content, .lesson-workspace { max-width: 100% !important; margin: 0 !important; }
  .lesson-card { background: #f8f8f8 !important; border: 1px solid #ddd !important; color: black !important; page-break-inside: avoid; }
  .lesson-heading, .lesson-card p, .lesson-card li { color: black !important; }
  .ws-textarea { color: black !important; background: white !important; border: 1px solid #ddd !important; min-height: 300px; }
  #wsCanvas { border: 1px solid #ddd !important; }
  .highlight-box { background: #f0f0f0 !important; border: 1px solid #ccc !important; color: black !important; }
  .highlight-box strong, .highlight-box p { color: black !important; }
  .prompt-box { background: #f5f0ff !important; border: 1px solid #c9b0ff !important; }
  .prompt-text { color: #333 !important; }
  .ws-panel[style*="display:none"] { display: none !important; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }

/* --- Selection --- */
::selection { background: rgba(26,143,227,0.35); color: white; }

/* ===================================================
   PARENT SUBSCRIPTION FEATURES — CSS
   Onboarding · Plans · Home Hub · Dashboard ·
   Family Activities · AI Sandbox · Certificates ·
   Discussion Prompts · Weekly Report
   =================================================== */

/* ── Subscription Badge ── */
.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.sub-badge--paid   { background: rgba(34,199,138,0.15); color: var(--green);  border: 1px solid rgba(34,199,138,0.35); }
.sub-badge--trial  { background: rgba(255,210,63,0.15); color: var(--yellow); border: 1px solid rgba(255,210,63,0.35); }
.sub-badge--free   { background: rgba(148,163,184,0.12); color: var(--gray2); border: 1px solid rgba(148,163,184,0.2); }

/* ── Utility ── */
.link-btn {
  background: none;
  border: none;
  color: var(--blue3);
  font-weight: 700;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

/* ===================================================
   ONBOARDING SCREEN
   =================================================== */
.ob-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
  max-width: 480px;
  margin: 0 auto;
}

.ob-dots {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  padding-top: 8px;
}

.ob-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: var(--transition);
}
.ob-dot.active { background: var(--blue); transform: scale(1.3); }
.ob-dot.done   { background: var(--green); }

.ob-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.ob-hero {
  font-size: 72px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.ob-title {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.2;
}

.ob-sub {
  font-size: 15px;
  color: var(--gray2);
  text-align: center;
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 380px;
}

.ob-feature-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.ob-feature-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.ob-feature-icon { font-size: 22px; flex-shrink: 0; }

.ob-feature-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.ob-feature-sub {
  font-size: 12px;
  color: var(--gray2);
}

.ob-trial-banner {
  width: 100%;
  background: rgba(255,210,63,0.1);
  border: 1px solid rgba(255,210,63,0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  text-align: center;
  color: var(--yellow);
  margin-bottom: 20px;
  line-height: 1.5;
}

.ob-btn {
  width: 100%;
  margin-bottom: 10px;
  font-size: 16px;
  padding: 16px;
}

.ob-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.ob-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray1);
  margin-bottom: 8px;
  display: block;
}

.ob-input {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: var(--transition);
}
.ob-input:focus {
  border-color: var(--blue);
  background: rgba(26,143,227,0.08);
}
.ob-input::placeholder { color: var(--gray3); }

.ob-grade-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.ob-grade-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.ob-grade-card:hover { border-color: rgba(26,143,227,0.5); }
.ob-grade-card.active {
  background: rgba(26,143,227,0.12);
  border-color: var(--blue);
}

.ob-grade-icon { font-size: 28px; margin-bottom: 6px; }
.ob-grade-label { font-size: 14px; font-weight: 800; }
.ob-grade-sub   { font-size: 12px; color: var(--gray2); margin-top: 2px; }

.ob-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.ob-avatar-opt {
  font-size: 28px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.ob-avatar-opt:hover { border-color: rgba(26,143,227,0.5); }
.ob-avatar-opt.selected {
  background: rgba(26,143,227,0.15);
  border-color: var(--blue);
}

.ob-ready-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ob-ready-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ob-ready-row:last-child { border-bottom: none; padding-bottom: 0; }
.ob-ready-row span { color: var(--gray2); }
.ob-ready-row strong { font-weight: 800; }

/* ===================================================
   SUBSCRIPTION PLANS SCREEN
   =================================================== */
.plans-screen {
  min-height: 100vh;
  padding: 0 0 48px;
}

.plans-header {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
  position: relative;
}

.plans-header .back-btn {
  position: absolute;
  left: 16px;
  top: 24px;
}

.plans-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
}

.plans-sub {
  font-size: 14px;
  color: var(--gray2);
  line-height: 1.5;
}

.plans-trial-note {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  background: rgba(255,210,63,0.1);
  border: 1px solid rgba(255,210,63,0.3);
  color: var(--yellow);
  border-radius: 20px;
  padding: 6px 16px;
}

.plans-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
  max-width: 500px;
  margin: 0 auto;
}

.plan-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  position: relative;
  transition: var(--transition);
}

.plan-card--featured {
  background: rgba(26,143,227,0.08);
  border-color: rgba(26,143,227,0.5);
  box-shadow: 0 0 0 1px rgba(26,143,227,0.2), 0 8px 32px rgba(26,143,227,0.15);
}

.plan-card--family {
  background: rgba(168,85,247,0.06);
  border-color: rgba(168,85,247,0.4);
}

.plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: var(--gray2);
  margin-bottom: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.plan-badge--featured { background: rgba(26,143,227,0.2); color: var(--blue3); }
.plan-badge--family   { background: rgba(168,85,247,0.2); color: var(--purple); }

.plan-icon   { font-size: 36px; margin-bottom: 8px; }
.plan-name   { font-size: 22px; font-weight: 900; margin-bottom: 10px; }

.plan-price  { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan-price-num { font-size: 36px; font-weight: 900; }
.plan-price-period { font-size: 14px; color: var(--gray2); }

.plan-annual {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.plan-feat-off { color: var(--gray3); }

.plan-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  margin-bottom: 8px;
}
.plan-btn--primary {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(26,143,227,0.3);
}
.plan-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,143,227,0.4); }
.plan-btn--family {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(168,85,247,0.3);
}
.plan-btn--family:hover { transform: translateY(-1px); }
.plan-btn--ghost {
  background: transparent;
  border: 1.5px solid var(--card-border);
  color: var(--gray2);
}
.plan-btn--ghost:hover { border-color: rgba(255,255,255,0.3); color: var(--white); }

.plan-note {
  font-size: 11px;
  color: var(--gray3);
  text-align: center;
}

.plans-guarantee {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 32px 16px 0;
  padding: 20px;
  background: rgba(34,199,138,0.06);
  border: 1px solid rgba(34,199,138,0.2);
  border-radius: var(--radius-lg);
  max-width: 468px;
  margin-left: auto;
  margin-right: auto;
}
.plans-guarantee-icon { font-size: 32px; flex-shrink: 0; }

/* ===================================================
   PARENT HOME HUB
   =================================================== */
.parent-home-screen {
  min-height: 100vh;
  padding: 0 0 80px;
}

.ph-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--card-border);
  gap: 12px;
}

.ph-greeting {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 2px;
}

.ph-date {
  font-size: 12px;
  color: var(--gray2);
}

.ph-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray2);
  padding: 20px 16px 8px;
}

.ph-child-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ph-child-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 10px 16px 10px 10px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.ph-child-chip.active  {
  background: rgba(26,143,227,0.12);
  border-color: rgba(26,143,227,0.5);
}
.ph-child-chip:hover   { border-color: rgba(255,255,255,0.3); }
.ph-child-chip--add    { opacity: 0.7; }

.ph-child-avatar { font-size: 26px; }
.ph-child-name   { font-size: 13px; font-weight: 800; margin-bottom: 1px; }
.ph-child-meta   { font-size: 11px; color: var(--gray2); }

.ph-child-card {
  margin: 12px 16px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.ph-child-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ph-child-card-avatar { font-size: 40px; }
.ph-child-card-name   { font-size: 18px; font-weight: 900; }
.ph-child-card-track  { font-size: 12px; color: var(--blue3); font-weight: 700; }

.ph-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251,146,60,0.15);
  color: var(--orange);
  border: 1px solid rgba(251,146,60,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ph-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ph-action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.ph-action-btn {
  flex: 1;
  min-width: 130px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid var(--card-border);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}
.ph-action-btn:hover { background: rgba(255,255,255,0.1); }
.ph-action-btn--primary {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(26,143,227,0.3);
}
.ph-action-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,143,227,0.4); }

.ph-recommend-card {
  margin: 0 16px 4px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.ph-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 20px;
}

.ph-feature-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.ph-feature-card:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.ph-feature-card--locked { opacity: 0.65; }

.ph-feature-icon  { font-size: 26px; margin-bottom: 6px; }
.ph-feature-label { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.ph-feature-sub   { font-size: 11px; color: var(--gray2); line-height: 1.4; }

.ph-feature-lock {
  font-size: 10px;
  font-weight: 800;
  color: var(--yellow);
  background: rgba(255,210,63,0.12);
  border-radius: 8px;
  padding: 3px 8px;
  margin-top: 6px;
  display: inline-block;
}

.ph-upgrade-banner {
  margin: 4px 16px 20px;
  background: linear-gradient(135deg, rgba(26,143,227,0.12), rgba(168,85,247,0.1));
  border: 1.5px solid rgba(26,143,227,0.35);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ph-upgrade-title { font-size: 16px; font-weight: 900; margin-bottom: 6px; }
.ph-upgrade-sub   { font-size: 13px; color: var(--gray2); line-height: 1.55; }

.ph-upgrade-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.ph-upgrade-btn:hover { transform: translateY(-1px); }

/* ===================================================
   PARENT DASHBOARD — Enhanced Tabs
   =================================================== */
.dash-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--card-border);
  gap: 12px;
  flex-shrink: 0;
}

.dash-title { font-size: 20px; font-weight: 900; margin-bottom: 2px; }

.dash-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray2);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.dash-tab:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.dash-tab.active {
  background: rgba(26,143,227,0.18);
  color: var(--white);
  border: 1px solid rgba(26,143,227,0.35);
}

.dash-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.dash-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray1);
  margin-bottom: 12px;
  margin-top: 4px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}
.stat-card.green  { background: rgba(34,199,138,0.08); border-color: rgba(34,199,138,0.3); }
.stat-card.blue   { background: rgba(26,143,227,0.08); border-color: rgba(26,143,227,0.3); }
.stat-card.yellow { background: rgba(255,210,63,0.08); border-color: rgba(255,210,63,0.3); }
.stat-card.purple { background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.3); }

.stat-card-n { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.stat-card-l { font-size: 11px; color: var(--gray2); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

.pd-overview {}
.pd-child-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.pd-child-avatar { font-size: 42px; }

.pd-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.pd-day-pill {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}
.pd-day-pill.active { background: rgba(34,199,138,0.12); border-color: rgba(34,199,138,0.4); }

.pd-day-name { font-size: 10px; color: var(--gray2); font-weight: 700; margin-bottom: 4px; }
.pd-day-icon { font-size: 13px; }

/* Settings reused styles (safety tab) */
.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--card-border);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.settings-row-sub   { font-size: 12px; color: var(--gray2); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===================================================
   FAMILY ACTIVITIES SCREEN
   =================================================== */
.fa-screen {
  min-height: 100vh;
}

.fa-filter-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  color: var(--gray2);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}
.fa-filter-btn:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }
.fa-filter-btn.active {
  background: rgba(26,143,227,0.18);
  border-color: var(--blue);
  color: var(--white);
}

.fa-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.fa-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.fa-card:hover { border-color: rgba(26,143,227,0.4); }

.fa-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fa-icon  { font-size: 30px; flex-shrink: 0; }
.fa-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.fa-meta  { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray2); }

.fa-tag {
  background: rgba(26,143,227,0.12);
  color: var(--blue3);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.fa-chevron {
  font-size: 12px;
  color: var(--gray3);
  margin-left: auto;
  flex-shrink: 0;
  transition: var(--transition);
}

.fa-body { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 12px; }
.fa-desc { font-size: 14px; color: var(--gray1); line-height: 1.65; }

/* ===================================================
   AI SANDBOX SCREEN
   =================================================== */
.sandbox-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
}

.sandbox-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  background: rgba(34,199,138,0.12);
  border: 1px solid rgba(34,199,138,0.3);
  border-radius: 20px;
  padding: 5px 12px;
}

.sandbox-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 16px;
  background: rgba(26,143,227,0.08);
  border: 1px solid rgba(26,143,227,0.25);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.sandbox-notice-icon { font-size: 24px; flex-shrink: 0; }

.sandbox-starters {
  padding: 0 16px 12px;
}

.sandbox-starter {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  color: var(--gray1);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.sandbox-starter:hover { background: rgba(26,143,227,0.15); border-color: rgba(26,143,227,0.4); color: var(--white); }

.sandbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-msg {
  max-width: 85%;
  border-radius: var(--radius);
  padding: 12px 16px;
}
.sandbox-msg--ai {
  background: rgba(26,143,227,0.1);
  border: 1px solid rgba(26,143,227,0.2);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.sandbox-msg--user {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.sandbox-msg-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.sandbox-msg-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--gray1);
}

.sandbox-input-row {
  display: flex;
  gap: 10px;
  padding: 10px 16px 20px;
  border-top: 1px solid var(--card-border);
  background: var(--navy);
  flex-shrink: 0;
}

.sandbox-input {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  transition: var(--transition);
}
.sandbox-input:focus { border-color: var(--blue); }
.sandbox-input::placeholder { color: var(--gray3); }

.sandbox-send {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.sandbox-send:hover { transform: translateY(-1px); }

/* ===================================================
   CERTIFICATE VIEWER SCREEN
   =================================================== */
.cert-screen {
  min-height: 100vh;
}

.cert-container {
  margin: 0 16px 20px;
}

.cert-inner {
  background: linear-gradient(135deg, var(--navy2), #1a2a4a);
  border: 2px solid rgba(77,184,255,0.3);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
}

.cert-border-top, .cert-border-bottom {
  height: 4px;
  background: linear-gradient(90deg, var(--blue3), var(--yellow), var(--green));
  border-radius: 2px;
  margin-bottom: 20px;
}
.cert-border-bottom { margin-top: 20px; margin-bottom: 0; }

.cert-academy {
  font-family: var(--font-brand);
  font-size: 20px;
  color: var(--blue3);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: .5px;
}

.cert-presents {
  font-size: 11px;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.cert-title-badge { font-size: 52px; margin-bottom: 8px; }

.cert-award-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--yellow);
  margin-bottom: 8px;
}

.cert-awarded-to {
  font-size: 11px;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.cert-name {
  font-size: 32px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 8px;
}

.cert-desc {
  font-size: 14px;
  color: var(--gray2);
  line-height: 1.5;
  margin-bottom: 20px;
}

.cert-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.cert-seal    { font-size: 40px; }
.cert-meta-item { text-align: center; }
.cert-meta-label { font-size: 10px; color: var(--gray2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.cert-meta-val   { font-size: 13px; font-weight: 800; }

.cert-signature {
  font-size: 11px;
  color: var(--gray3);
  margin-top: 16px;
}

.cert-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.cert-actions .ph-action-btn { flex: 1; }

/* ===================================================
   DISCUSSION PROMPTS SCREEN
   =================================================== */
.dp-screen {
  min-height: 100vh;
}

.dp-grade-tabs {
  display: flex;
  gap: 10px;
  padding: 0 16px 20px;
  justify-content: center;
}

.dp-grade-btn {
  flex: 1;
  max-width: 180px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--gray2);
  transition: var(--transition);
}
.dp-grade-btn:hover { border-color: rgba(255,255,255,0.3); color: var(--white); }
.dp-grade-btn.active {
  background: rgba(26,143,227,0.15);
  border-color: var(--blue);
  color: var(--white);
}

.dp-category {
  padding: 0 16px;
  margin-bottom: 16px;
}

.dp-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: var(--transition);
}
.dp-card:hover { border-color: rgba(77,184,255,0.3); }

.dp-q-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(26,143,227,0.2);
  color: var(--blue3);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dp-q-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray1);
}

.dp-try-btn {
  background: rgba(26,143,227,0.1);
  border: 1px solid rgba(26,143,227,0.25);
  color: var(--blue3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}
.dp-try-btn:hover { background: rgba(26,143,227,0.2); }

/* ===================================================
   WEEKLY REPORT SCREEN
   =================================================== */
.wr-screen {
  min-height: 100vh;
}

.wr-hero {
  text-align: center;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}

.wr-hero-avatar { font-size: 52px; margin-bottom: 8px; }
.wr-hero-name   { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.wr-hero-date   { font-size: 13px; color: var(--gray2); }

.wr-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 16px 20px;
}

@media (min-width: 480px) {
  .wr-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.wr-stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}

.wr-stat-n { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.wr-stat-l { font-size: 11px; color: var(--gray2); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

.wr-section {
  margin: 0 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.wr-section-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
}

.wr-lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wr-lesson-row:last-child { border-bottom: none; padding-bottom: 0; }

.wr-prompt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray1);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wr-prompt:last-child { border-bottom: none; }
.wr-prompt-num { font-weight: 900; color: var(--blue3); flex-shrink: 0; }

.wr-next-section {
  background: rgba(34,199,138,0.05);
  border-color: rgba(34,199,138,0.2);
}

.wr-parent-note {
  margin: 0 16px 32px;
  background: rgba(26,143,227,0.07);
  border: 1px solid rgba(26,143,227,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ===================================================
   PARENT EXPERIENCE UPGRADES
   Co-learning panel · Lesson summary · Notification toggle
   =================================================== */

/* ── Co-Learning Toggle Button (injected into lesson top-bar) ── */
.co-learn-toggle {
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--card-border);
  background: rgba(255,255,255,0.06);
  color: var(--gray2);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-left: auto;
}
.co-learn-toggle:hover {
  border-color: rgba(34,199,138,0.4);
  color: var(--white);
}
.co-learn-toggle.active {
  background: rgba(34,199,138,0.15);
  border-color: var(--green);
  color: var(--green);
}

/* ── Co-Learning Panel (fixed bottom drawer) ── */
.co-learn-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: linear-gradient(180deg, #0e1f3a 0%, #0A1628 100%);
  border-top: 2px solid rgba(34,199,138,0.35);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  max-height: 55vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  animation: slideUp 0.28s cubic-bezier(0.4,0,0.2,1);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.co-learn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(34,199,138,0.2);
  position: sticky;
  top: 0;
  background: #0e1f3a;
  z-index: 1;
}

.co-learn-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--green);
  letter-spacing: .3px;
}

.co-learn-close {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
  color: var(--gray2);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: var(--transition);
}
.co-learn-close:hover { background: rgba(255,255,255,0.15); color: var(--white); }

.co-learn-body {
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.co-learn-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.co-learn-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--blue3);
  margin-bottom: 8px;
}

.co-learn-tip {
  font-size: 13px;
  color: var(--gray1);
  line-height: 1.65;
}

.co-learn-questions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.co-learn-q {
  font-size: 13px;
  color: var(--gray1);
  line-height: 1.55;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.co-learn-q:last-child { border-bottom: none; padding-bottom: 0; }

.co-learn-extension { border-color: rgba(34,199,138,0.25); }
.co-learn-extension .co-learn-label { color: var(--green); }

/* ── ARIA Lesson Summary in Weekly Report ── */
.wr-aria-summary {
  font-size: 12px;
  color: var(--blue3);
  font-style: italic;
  line-height: 1.55;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(26,143,227,0.07);
  border-left: 3px solid rgba(26,143,227,0.4);
  border-radius: 0 6px 6px 0;
}

/* ===================================================
   RESPONSIVE — parent screens on wider displays
   =================================================== */
@media (min-width: 600px) {
  .plans-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .plan-card {
    flex: 1;
    min-width: 220px;
  }
  .ph-feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .dash-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .ob-avatar-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* ===================================================
   ENHANCEMENT FEATURES
   Quiz Types · Confetti · PWA Banner · Export/Import
   =================================================== */

/* ── Quiz Type Pill ── */
.quiz-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(26,143,227,0.12);
  border: 1px solid rgba(26,143,227,0.3);
  color: var(--blue3);
  margin-bottom: 12px;
  letter-spacing: .3px;
}
.quiz-type-pill--tf {
  background: rgba(255,210,63,0.12);
  border-color: rgba(255,210,63,0.35);
  color: var(--yellow);
}
.quiz-type-pill--fill {
  background: rgba(34,199,138,0.10);
  border-color: rgba(34,199,138,0.30);
  color: var(--green);
}

/* ── True / False question ── */
.tf-statement {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.55;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.tf-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.tf-btn {
  flex: 1;
  max-width: 180px;
  padding: 18px 16px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid var(--card-border);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
}
.tf-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }

.tf-btn.tf-correct {
  background: rgba(34,199,138,0.18);
  border-color: var(--green);
  color: var(--green);
}
.tf-btn.tf-wrong {
  background: rgba(239,68,68,0.15);
  border-color: var(--red);
  color: var(--red);
}
.tf-btn.tf-dim {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Fill in the Blank ── */
.fill-hint {
  font-size: 14px;
  color: var(--gray2);
  margin-bottom: 14px;
  line-height: 1.55;
}

.fill-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.fill-input {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  padding: 13px 16px;
  outline: none;
  transition: var(--transition);
}
.fill-input:focus { border-color: var(--blue); background: rgba(26,143,227,0.08); }
.fill-input::placeholder { color: var(--gray3); }
.fill-input.fill-correct { border-color: var(--green); background: rgba(34,199,138,0.10); }
.fill-input.fill-wrong   { border-color: var(--red);   background: rgba(239,68,68,0.08); }

.fill-submit {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.fill-submit:hover { transform: translateY(-1px); }
.fill-submit:disabled { opacity: 0.5; pointer-events: none; }

.fill-reveal {
  font-size: 13px;
  color: var(--gray2);
  margin-top: 6px;
  line-height: 1.55;
}
.fill-reveal strong { color: var(--green); }

@keyframes fill-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.fill-shake { animation: fill-shake 0.4s ease; }

/* ── Confetti ── */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
  transform-origin: center center;
}

.confetti-round {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

@keyframes confetti-fall {
  0% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  85% { opacity: 1; }
  100% {
    transform: translateX(var(--drift)) rotate(720deg) translateY(100vh);
    opacity: 0;
  }
}

/* ── PWA Install Banner ── */
.pwa-banner {
  position: fixed;
  bottom: -140px;
  left: 0;
  right: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0e1f3a, #112244);
  border-top: 2px solid rgba(26,143,227,0.5);
  box-shadow: 0 -6px 30px rgba(0,0,0,0.45);
  transition: bottom 0.4s cubic-bezier(0.4,0,0.2,1);
}
.pwa-banner.visible { bottom: 0; }

.pwa-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.pwa-banner-text { flex: 1; min-width: 0; }

.pwa-banner-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 2px;
  color: var(--white);
}

.pwa-banner-sub {
  font-size: 12px;
  color: var(--gray2);
  line-height: 1.4;
}

.pwa-banner-btn {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
  font-family: var(--font);
}
.pwa-banner-btn:hover { transform: translateY(-1px); }

.pwa-banner-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
  color: var(--gray2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  font-family: var(--font);
}
.pwa-banner-close:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* ── Export / Import Settings Buttons ── */
.export-btn {
  background: rgba(26,143,227,0.12);
  border: 1.5px solid rgba(26,143,227,0.3);
  color: var(--blue3);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: var(--font);
}
.export-btn:hover { background: rgba(26,143,227,0.22); }

.import-label {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--card-border);
  color: var(--gray2);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: var(--font);
}
.import-label:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.coming-soon-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--purple);
  letter-spacing: .3px;
}

/* ===================================================
   BADGE GALLERY SCREEN
   =================================================== */

.bg-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero strip ── */
.bg-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255,210,63,0.04);
}

.bg-hero-ring {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
  background: rgba(255,210,63,0.1);
  border: 2px solid rgba(255,210,63,0.3);
  border-radius: 50%;
  width: 72px;
  height: 72px;
  justify-content: center;
  align-items: center;
  flex-direction: row;
}

.bg-hero-count {
  font-size: 26px;
  font-weight: 900;
  color: var(--yellow);
}

.bg-hero-denom {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray2);
}

.bg-hero-text { flex: 1; }

.bg-hero-label {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--white);
}

.bg-hero-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.bg-hero-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.bg-hero-empty {
  font-size: 12px;
  color: var(--gray2);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── XP progress row ── */
.bg-xp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.bg-xp-label {
  font-size: 12px;
  color: var(--gray2);
  flex: 1;
  min-width: 160px;
}
.bg-xp-label strong { color: var(--yellow); }

.bg-xp-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray2);
  white-space: nowrap;
  flex-shrink: 0;
}

.bg-xp-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  flex-basis: 100%;
  margin-top: 2px;
}

.bg-xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 99px;
  transition: width 0.8s ease;
}

/* ── Body + category sections ── */
.bg-body {
  padding: 0 16px 40px;
}

.bg-section {
  margin-top: 24px;
}

.bg-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
}

/* ── Badge grid ── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 480px) { .badge-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .badge-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Badge tile ── */
.badge-tile {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.badge-tile--earned {
  background: rgba(255,210,63,0.07);
  border-color: rgba(255,210,63,0.3);
}

.badge-tile--new {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255,210,63,0.25), 0 4px 16px rgba(255,210,63,0.2);
}

.badge-tile-new-tag {
  position: absolute;
  top: -1px;
  right: -1px;
  font-size: 9px;
  font-weight: 800;
  background: var(--yellow);
  color: #000;
  border-radius: 0 var(--radius) 0 6px;
  padding: 2px 6px;
  letter-spacing: .5px;
}

.badge-tile-emoji {
  font-size: 32px;
  margin-bottom: 6px;
  display: block;
  line-height: 1.1;
}

.badge-tile-emoji--glow {
  filter: drop-shadow(0 0 8px rgba(255,210,63,0.55));
  animation: badge-glow 2.5s ease-in-out infinite;
}

.badge-tile-emoji--locked {
  filter: grayscale(1) opacity(0.35);
}

.badge-tile-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 4px;
}

.badge-tile--earned .badge-tile-name { color: var(--white); }

.badge-tile-earned-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--yellow);
}

.badge-tile-hint {
  font-size: 10px;
  color: var(--gray3);
  line-height: 1.35;
}

@keyframes badge-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,210,63,0.4)); }
  50%       { filter: drop-shadow(0 0 14px rgba(255,210,63,0.75)); }
}

/* ── Share row ── */
.bg-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding: 16px 18px;
  background: rgba(26,143,227,0.07);
  border: 1px solid rgba(26,143,227,0.2);
  border-radius: var(--radius-lg);
}

.bg-share-headline {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 3px;
}

.bg-share-sub {
  font-size: 12px;
  color: var(--gray2);
}

.bg-share-btn {
  background: rgba(26,143,227,0.15);
  border: 1.5px solid rgba(26,143,227,0.35);
  color: var(--blue3);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
  font-family: var(--font);
}
.bg-share-btn:hover { background: rgba(26,143,227,0.25); }

/* ===================================================
   BADGE TOAST  — slides up from bottom-right
   =================================================== */

.badge-toast {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9800;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a2e50, #0e1f3a);
  border: 2px solid rgba(255,210,63,0.5);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,210,63,0.15);
  max-width: 300px;
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
  pointer-events: auto;
}

.badge-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.badge-toast-emoji {
  font-size: 36px;
  flex-shrink: 0;
  animation: badge-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.35s both;
}

@keyframes badge-pop {
  0%   { transform: scale(0.3) rotate(-15deg); }
  70%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1)   rotate(0deg); }
}

.badge-toast-body { flex: 1; min-width: 0; }

.badge-toast-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 3px;
}

.badge-toast-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 2px;
}

.badge-toast-desc {
  font-size: 12px;
  color: var(--gray2);
  line-height: 1.4;
}

.badge-toast-close {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
  color: var(--gray2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font);
  transition: var(--transition);
}
.badge-toast-close:hover { background: rgba(255,255,255,0.18); color: var(--white); }

/* ===================================================
   ACCESSIBILITY & OFFLINE RESILIENCE
   =================================================== */

/* ── Skip link (keyboard users only) ── */
.skip-link {
  position: fixed;
  top: -56px;
  left: 12px;
  z-index: 99999;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top 0.18s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ── Global keyboard focus ring ──
   Shows only for keyboard navigation (not mouse clicks).
   Overrides the outline:none set on individual elements. ── */
*:focus-visible {
  outline: 3px solid #4DB8FF !important;
  outline-offset: 3px !important;
  border-radius: 4px !important;
}
/* Let inputs keep their border-based focus style */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #4DB8FF !important;
  outline-offset: 0 !important;
  border-radius: var(--radius) !important;
}

/* ── Offline banner ── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border-bottom: 1px solid rgba(255,100,100,0.3);
  font-size: 13px;
  font-weight: 700;
  color: #fecaca;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  animation: slideDown 0.25s ease;
}

.offline-banner--back {
  background: linear-gradient(135deg, #14532d, #166534);
  border-bottom-color: rgba(74,222,128,0.3);
  color: #bbf7d0;
  animation: none;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.offline-banner-icon { font-size: 16px; flex-shrink: 0; }
.offline-banner-text { flex: 1; line-height: 1.4; }

/* ── Visually-hidden utility (for screen-reader-only text) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================================================
   TTS WORD-KARAOKE READING STRIP
   Slides up from the bottom while ARIA reads aloud.
   Each word is wrapped in a span; the Web Speech API
   'boundary' event highlights the current word live.
   =================================================== */
.tts-strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(5, 12, 27, 0.97);
  border-top: 3px solid #4DB8FF;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 22px 18px;
  z-index: 9990;
  max-height: 112px;
  overflow-y: auto;
  scrollbar-width: none;
  font-size: 1.08rem;
  line-height: 2;
  color: #a8c0d6;
  letter-spacing: 0.01em;
  transform: translateY(100%);
  transition: transform 0.34s cubic-bezier(.22,.68,0,1.2);
  pointer-events: none;   /* never blocks clicks on content behind it */
}
.tts-strip::-webkit-scrollbar { display: none; }
.tts-strip.visible            { transform: translateY(0); }

/* Individual word tokens */
.tts-word {
  display: inline;
  border-radius: 5px;
  padding: 1px 3px;
  margin: 0 1px;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

/* Currently-spoken word */
.tts-word.tts-active {
  background: #4DB8FF;
  color: #050e1c;
  font-weight: 700;
  border-radius: 5px;
  box-shadow: 0 0 16px rgba(77,184,255,0.55);
  animation: tts-pop 0.22s ease;
}

@keyframes tts-pop {
  0%   { transform: scale(1.18); }
  100% { transform: scale(1);    }
}

/* ===================================================
   REAL-WORLD CONNECTION CALLOUT  🌍
   Appears on the core (Main Lesson) stage only.
   =================================================== */
.rw-box {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(6,182,212,0.08));
  border: 1.5px solid rgba(16,185,129,0.35);
  border-left: 4px solid #10b981;
  border-radius: 14px;
  padding: 16px 18px;
  animation: animate-in 0.4s ease both;
}
.rw-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #10b981;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.rw-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray1);
  margin: 0;
}

/* ===================================================
   KEY TERMS GLOSSARY  📖
   Collapsible panel — visible on every lesson stage.
   =================================================== */
.kt-panel {
  margin-top: 20px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  animation: animate-in 0.4s ease 0.1s both;
}
.kt-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 800;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.18s;
}
.kt-summary::-webkit-details-marker { display: none; }
.kt-summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 12px;
  color: var(--gray3);
  transition: transform 0.22s;
}
.kt-panel[open] .kt-summary::after { transform: rotate(90deg); }
.kt-summary:hover { background: rgba(77,184,255,0.06); }

.kt-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(77,184,255,0.15);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 20px;
}

.kt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  padding: 4px 14px 16px;
}
.kt-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.18s, transform 0.18s;
}
.kt-card:hover {
  border-color: rgba(77,184,255,0.4);
  transform: translateY(-2px);
}
.kt-term {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 5px;
}
.kt-def {
  font-size: 13px;
  line-height: 1.55;
  color: var(--gray2);
}
