/* ZYER styles. Brand colours come from the official brand sheet. */

@font-face {
  font-family: "OpenDyslexic";
  src: url("../fonts/OpenDyslexic-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("../fonts/OpenDyslexic-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --midnight: #0B1B3B; /* Trust & Focus */
  --blue: #3B82F6;     /* Confidence & Progress */
  --teal: #14B8A6;     /* Growth & Learning: correct answers only */
  --sunshine: #FBBF24; /* Energy & Positivity: stars, streaks, rewards */
  --orange: #F97316;   /* Creativity & Motivation: mistakes, hints, Sage */
  --purple: #8B5CF6;   /* Imagination & Support: subjects, profiles, Moon */
  --paper: #F7F8FB;
  --line: #E3E7EF;
  --muted: #55607A;
  --display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--midnight);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0; }
p { margin: 0; }
img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Reading surface for kids ---------- */
/* Wide spacing for every child. The typeface changes only when the toggle is on. */
.kid-type {
  font-size: 1.15rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  word-spacing: 0.12em;
}
.kid-type.font-dyslexic,
.kid-type.font-dyslexic :is(h1, h2, h3, p, span, button, label, input, li, strong) {
  font-family: "OpenDyslexic", var(--body);
  letter-spacing: 0.03em;
  word-spacing: 0.18em;
}
.kid-type.font-dyslexic { line-height: 1.9; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; }
.logo-word { display: inline-flex; align-items: flex-end; font-family: var(--display); font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.logo-y { height: 0.98em; width: 0.7em; margin: 0 0.02em; transform: translateY(-0.16em); }
.logo-tm { align-self: flex-start; font-family: var(--body); font-size: 0.16em; margin-left: 0.2em; }
.logo-tagline { margin-top: 0.8rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.3em; }
.logo-tagline b { color: var(--sunshine); }
.logo-sm .logo-word { font-size: 1.7rem; }
.logo-md .logo-word { font-size: 2.6rem; }
.logo-lg .logo-word { font-size: 3.8rem; }
.logo-xl .logo-word { font-size: clamp(3.8rem, 13vw, 5.5rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 0; border-radius: 999px; padding: 0.85rem 1.6rem;
  font-weight: 800; text-decoration: none; transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-midnight { background: var(--midnight); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-soft { background: #fff; color: var(--midnight); box-shadow: inset 0 0 0 2px var(--line); }
.btn-wide { width: 100%; }
.btn-big { padding: 1.1rem 2rem; font-size: 1.15rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgba(11, 27, 59, 0.06); font-size: 1.2rem;
}

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px #fff; flex-shrink: 0; }

/* ---------- Panels and settings ---------- */
.panel { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 0 rgba(11, 27, 59, 0.08); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting-label { font-weight: 800; }
.setting-help { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.switch {
  position: relative; width: 58px; height: 34px; flex-shrink: 0; border: 0; border-radius: 999px;
  background: #CBD2E0; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch[aria-checked="true"] { background: var(--purple); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.segmented { display: inline-flex; background: rgba(11, 27, 59, 0.06); border-radius: 999px; padding: 4px; flex-shrink: 0; }
.segmented button { border: 0; background: none; border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 800; color: var(--muted); }
.segmented button[aria-checked="true"] { background: var(--blue); color: #fff; }

/* ---------- Kids gateway ---------- */
.gateway {
  position: relative; min-height: 100vh; overflow: hidden; display: grid; place-items: center;
  background: var(--midnight); color: #fff; text-align: center; padding: 2rem 1.5rem;
}
.blob { position: absolute; border-radius: 50%; pointer-events: none; }
.gateway-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.gateway h1 { margin-top: 2.5rem; font-size: clamp(1.8rem, 6vw, 2.4rem); }
.gateway .hi { margin-top: 2.5rem; color: var(--sunshine); font-weight: 800; font-size: 1.3rem; }
.gateway .hi + h1 { margin-top: 0.3rem; }
.tap-enter {
  margin-top: 3rem; border: 0; border-radius: 999px; padding: 1.4rem 3.6rem;
  background: var(--sunshine); color: var(--midnight); font-family: var(--display); font-weight: 700; font-size: 1.6rem;
  animation: zyer-pulse 2s ease-in-out infinite;
}
@keyframes zyer-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 18px rgba(251, 191, 36, 0); }
}
.corner-btn { position: absolute; top: 1rem; right: 1rem; background: rgba(255, 255, 255, 0.12); color: #fff; z-index: 2; }

/* ---------- Settings sheet ---------- */
dialog.sheet {
  border: 0; border-radius: var(--radius); padding: 1.5rem; width: min(92vw, 460px);
  color: var(--midnight); background: #fff;
}
dialog.sheet::backdrop { background: rgba(11, 27, 59, 0.55); }
dialog.sheet h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* ---------- Lesson ---------- */
.lesson { max-width: 680px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.lesson-top { display: flex; align-items: center; gap: 0.75rem; }
.lesson-top .subject { font-family: var(--display); font-weight: 600; font-size: 1.15rem; flex: 1; }
.progress { margin: 0.9rem 0 0.2rem; display: flex; align-items: center; gap: 0.75rem; }
.progress-track { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.4s ease; }
.progress-count { font-size: 0.9rem; font-weight: 800; color: var(--muted); }
.stage-label { margin-top: 1.5rem; font-weight: 800; color: var(--purple); font-size: 0.95rem; }
.prompt { margin-top: 0.3rem; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 700; }
.say-it {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.9rem; padding: 0.8rem 1rem;
  border-radius: 16px; background: rgba(59, 130, 246, 0.08); font-size: 1rem;
}
.read-btn { margin-top: 1rem; }

.options { display: grid; gap: 0.75rem; margin-top: 1.4rem; }
.option {
  display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left;
  padding: 0.9rem 1rem; border-radius: 16px; border: 2px solid var(--line); background: #fff;
  font-size: 1.2rem; font-weight: 700; transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--blue); }
.option .letter {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--paper); font-weight: 800; font-size: 0.95rem; flex-shrink: 0;
}
.option.correct { background: var(--teal); border-color: var(--teal); color: #fff; }
.option.correct .letter { background: rgba(255, 255, 255, 0.25); }
.option.wrong { border-color: var(--orange); background: #FFF4EC; }
.option:disabled { cursor: default; }

.answer-row { display: flex; gap: 0.75rem; margin-top: 1.4rem; flex-wrap: wrap; }
.answer-input {
  flex: 1; min-width: 180px; padding: 0.9rem 1.1rem; font-size: 1.3rem; font-weight: 700;
  border: 2px solid var(--line); border-radius: 16px; background: #fff; color: var(--midnight);
}
.answer-input:focus { border-color: var(--blue); outline: none; }

/* Feedback from the characters */
.feedback {
  margin-top: 1.4rem; border-radius: var(--radius); padding: 1.1rem 1.2rem;
  animation: slide-in 0.35s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.feedback-good { background: var(--teal); color: #fff; }
.feedback-sage { background: #FFF1E6; box-shadow: inset 0 0 0 2px var(--orange); }
.feedback-moon { background: #F1EBFF; box-shadow: inset 0 0 0 2px var(--purple); }
.feedback-head { display: flex; gap: 0.9rem; align-items: center; }
.feedback-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.feedback-body { margin-top: 0.7rem; }
.steps { margin: 0.7rem 0 0; padding-left: 1.3rem; }
.steps li + li { margin-top: 0.3rem; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.sage-tip {
  display: flex; gap: 0.8rem; align-items: center; margin-top: 1rem; padding: 0.8rem 1rem;
  border-radius: 16px; background: #FFF1E6; font-size: 1rem;
}

/* Flip flashcards */
.flip { perspective: 1400px; margin-top: 1.4rem; }
.flip-inner {
  display: grid; min-height: 300px; transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 1.8rem; border-radius: 28px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.flip-front { background: var(--purple); color: #fff; cursor: pointer; border: 0; width: 100%; }
.flip-back { background: #fff; box-shadow: inset 0 0 0 3px var(--teal); transform: rotateY(180deg); }
.flip-front .card-q { font-family: var(--display); font-size: clamp(1.6rem, 5.5vw, 2.1rem); font-weight: 700; line-height: 1.3; }
.flip-front .card-hint { margin-top: 1.2rem; font-size: 0.95rem; opacity: 0.9; }
.flip-back .card-a { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--teal); }
.flip-back .card-explain { margin-top: 0.8rem; }
.card-icon { font-size: 2.6rem; margin-bottom: 0.6rem; }

/* Breathing reset */
.breathe { text-align: center; padding-top: 1.5rem; }
.breathe-stage { position: relative; width: 260px; height: 260px; margin: 2rem auto 1rem; display: grid; place-items: center; }
.breathe-ring {
  position: absolute; inset: 0; border-radius: 50%; background: rgba(59, 130, 246, 0.14);
  transform: scale(0.55); transition-property: transform; transition-timing-function: ease-in-out;
}
.breathe-ring.in { transform: scale(1); }
.breathe-cue { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--blue); min-height: 2.4rem; }
.breathe-time { margin-top: 0.4rem; color: var(--muted); font-weight: 800; }

/* Hype summary */
.summary { text-align: center; padding-top: 1.5rem; }
.stars { font-size: 2.4rem; margin-top: 1rem; letter-spacing: 0.2rem; }
.stickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-top: 1.5rem; }
.sticker { padding: 1rem; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.sticker.earned { box-shadow: inset 0 0 0 3px var(--sunshine); background: #FFF9E6; }
.sticker .emoji { font-size: 2.2rem; }
.sticker p { font-weight: 800; margin-top: 0.3rem; }
.sticker span { font-size: 0.9rem; color: var(--muted); }

/* ---------- Simple pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page h1 { font-size: 2.4rem; margin-top: 2.2rem; }
.lead { margin-top: 0.5rem; font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.stack > * + * { margin-top: 1.2rem; }
.status { list-style: none; padding: 0; margin: 0; }
.status li { display: flex; gap: 0.8rem; padding: 0.75rem 0; }
.status li + li { border-top: 1px solid var(--line); }
.status .dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.85rem; margin-top: 2px; }
.dot.ok { background: var(--teal); }
.dot.fail { background: var(--orange); }
.dot.wait { background: var(--blue); }
.status small { display: block; color: var(--muted); }
.char-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.char-card { border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.char-card h3 { font-size: 1.3rem; margin-top: 0.5rem; }
.char-card .role { font-size: 0.95rem; color: var(--muted); flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Forms (Parent Portal) ---------- */
.field { display: block; margin-top: 1rem; }
.field > span { display: block; font-weight: 800; margin-bottom: 0.35rem; }
.input {
  width: 100%; padding: 0.8rem 1rem; font: inherit; font-size: 1.05rem; color: var(--midnight);
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
}
.input:focus { border-color: var(--blue); outline: none; }
.check { display: flex; gap: 0.75rem; align-items: flex-start; margin-top: 1.2rem; font-size: 0.95rem; line-height: 1.55; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--purple); flex-shrink: 0; }
.msg { margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 14px; font-weight: 700; font-size: 0.95rem; }
.msg-error { background: #FFF1E6; color: #9A3412; }
.msg-info { background: #E7F8F6; color: #0F766E; }
.divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0 0.4rem; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #fff; color: var(--midnight); box-shadow: inset 0 0 0 2px var(--line); width: 100%; }
.btn-google svg { width: 20px; height: 20px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- Parent dashboard ---------- */
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kid-chip {
  display: inline-grid; place-items: center; border-radius: 50%; color: #fff; flex-shrink: 0;
  font-family: var(--display); font-weight: 700; box-shadow: 0 0 0 4px #fff;
}
.child-head { display: flex; align-items: center; gap: 1rem; }
.child-head h3 { font-size: 1.5rem; }
.child-head p { color: var(--muted); font-size: 0.95rem; }
.sub-title { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin-top: 1.4rem; }
.session { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.session:first-of-type { border-top: 0; }
.session-meta { color: var(--muted); font-size: 0.9rem; }
.session ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.add-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.add-row .input { flex: 1; min-width: 200px; }

/* ---------- Kids: who's learning ---------- */
.who { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; margin-top: 2rem; }
.who button {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; border: 0; background: none;
  color: #fff; font-family: var(--display); font-weight: 600; font-size: 1.3rem; padding: 0.5rem;
}
.who .kid-chip { width: 96px; height: 96px; font-size: 2.6rem; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9); }
.gateway .note { margin-top: 1.5rem; max-width: 30ch; color: rgba(255, 255, 255, 0.85); }
.gateway .switch-kid { margin-top: 1.6rem; background: none; border: 0; color: rgba(255, 255, 255, 0.8); text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }

/* ---------- Kids home: subject folders ---------- */
.kids-home { max-width: 760px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.kids-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kids-home h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); margin-top: 1.6rem; }
.kids-home .sub { color: var(--muted); margin-top: .2rem; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; margin-top: 1.5rem; }
.subject-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  text-align: left; border: 0; border-radius: var(--radius); padding: 1.1rem; min-height: 150px;
  background: #fff; box-shadow: inset 0 0 0 2px #E4DAFD; transition: transform 0.15s, box-shadow 0.15s;
}
.subject-tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--purple); }
.subject-tile .icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  background: var(--purple); font-size: 1.6rem;
}
.subject-tile .name { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.subject-tile .level { font-size: 0.85rem; color: var(--muted); line-height: 1.3; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 999px; padding: 0.2rem 0.7rem;
  background: var(--sunshine); color: var(--midnight); font-weight: 800; font-size: 0.8rem; line-height: 1.4;
}
.lesson-list { display: grid; gap: 0.8rem; margin-top: 1.4rem; }
.lesson-card {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; border: 0;
  border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; box-shadow: inset 0 0 0 2px var(--line);
}
.lesson-card:hover { box-shadow: inset 0 0 0 2px var(--purple); }
.lesson-card .icon { font-size: 1.8rem; }
.lesson-card .title { font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }
.lesson-card .meta { font-size: 0.9rem; color: var(--muted); }
.lesson-card .go { margin-left: auto; font-size: 1.4rem; color: var(--purple); }
.revise-card { background: #FFF7DF; box-shadow: inset 0 0 0 2px var(--sunshine); }

/* Parent progress bars */
.topic-row { padding: 0.55rem 0; }
.topic-row .bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.3rem; }
.topic-row .bar span { display: block; height: 100%; border-radius: 999px; }
.topic-row .meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.topic-row .meta b { white-space: nowrap; }

/* =====================================================================
   Lesson v2: game feel
   ===================================================================== */
.lesson { max-width: 680px; padding-bottom: 2rem; }
.lesson-top { gap: 0.5rem; }
.path { display: flex; gap: 0.35rem; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; }
.path li {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-size: 1rem; transition: transform 0.25s, background 0.25s;
}
.path li.done { background: var(--teal); box-shadow: none; filter: saturate(0.9); }
.path li.current { background: var(--purple); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25); transform: scale(1.15); }
.xp-pill, .combo {
  display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 999px; padding: 0.3rem 0.7rem;
  font-weight: 800; font-size: 0.95rem; white-space: nowrap;
}
.xp-pill { background: var(--sunshine); color: var(--midnight); }
.combo { background: var(--orange); color: #fff; }
.bump { animation: bump 0.35s ease; }
@keyframes bump { 50% { transform: scale(1.25); } }
.progress-track.thin { height: 6px; margin: 0.7rem 0 0; }
.enter { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.row-center { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; align-items: center; margin-top: 1.2rem; }

/* Question card */
.q-card {
  position: relative; margin-top: 0.6rem; padding: 1.4rem 3.4rem 1.4rem 1.4rem; border-radius: 24px;
  background: #fff; box-shadow: 0 2px 0 rgba(11, 27, 59, 0.06), 0 10px 30px rgba(11, 27, 59, 0.06);
}
.q-card .prompt { margin: 0; }
.read-icon {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(59, 130, 246, 0.12); font-size: 1.15rem;
}
.learn-head .read-icon { position: static; flex-shrink: 0; margin-left: auto; }
.say-chip { display: inline-block; margin-top: 0.8rem; padding: 0.35rem 0.85rem; border-radius: 999px; background: rgba(59, 130, 246, 0.1); font-size: 0.92rem; font-weight: 700; }
.voice-note { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }

/* Chunky answer buttons */
.options { gap: 0.8rem; }
.option {
  border: 0; box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); transform: translateY(0);
  animation: enter 0.3s ease both; transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.option:hover { box-shadow: inset 0 0 0 2px var(--blue), 0 4px 0 #BFD4FB; }
.option:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--blue), 0 1px 0 #BFD4FB; }
.option.correct { background: var(--teal); color: #fff; box-shadow: 0 4px 0 #0E8F81; animation: pop 0.35s ease; }
.option.wrong { background: #FFF4EC; box-shadow: inset 0 0 0 2px var(--orange), 0 4px 0 #F9C9A6; animation: shake 0.4s ease; opacity: 0.85; }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shake 0.4s ease; }
.answer-input { box-shadow: 0 4px 0 var(--line); }
.answer-input.correct { border-color: var(--teal); background: #E7F8F6; }

/* Boss challenge */
.boss .stage-label { color: #B7791F; font-size: 1.05rem; }
.boss .q-card { box-shadow: inset 0 0 0 3px var(--sunshine), 0 0 0 6px rgba(251, 191, 36, 0.2), 0 10px 30px rgba(251, 191, 36, 0.25); background: #FFFCF2; }

/* Feedback sheet that slides up from the bottom */
.sheet-feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-inner {
  width: 100%; max-width: 680px; max-height: 70vh; overflow-y: auto; border-radius: 28px 28px 0 0;
  padding: 1.3rem 1.3rem calc(1.3rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(11, 27, 59, 0.18);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-good .sheet-inner { background: var(--teal); color: #fff; }
.sheet-sage .sheet-inner { background: #FFF1E6; box-shadow: inset 0 4px 0 var(--orange), 0 -10px 40px rgba(11, 27, 59, 0.18); }
.sheet-moon .sheet-inner { background: #F1EBFF; box-shadow: inset 0 4px 0 var(--purple), 0 -10px 40px rgba(11, 27, 59, 0.18); }
.sheet-head { display: flex; gap: 0.9rem; align-items: center; }
.sheet-title { font-family: var(--display); font-weight: 700; font-size: 1.45rem; line-height: 1.2; }
.sheet-why, .sheet-clue { margin-top: 0.8rem; }
.sheet-good .sheet-why { background: rgba(255, 255, 255, 0.16); border-radius: 14px; padding: 0.7rem 0.9rem; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.sheet-actions .btn { flex: 1; min-width: 140px; }
.sheet-inner > .btn { margin-top: 1rem; }
.tick { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--teal); font-size: 1.8rem; font-weight: 800; flex-shrink: 0; animation: pop 0.4s ease; }
.btn-white { background: #fff; color: #0E8F81; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12); }
.has-sheet .stage { padding-bottom: 320px; }
.moon-breathe { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--purple); }
.moon-ring { width: 46px; height: 46px; border-radius: 50%; background: rgba(139, 92, 246, 0.25); transform: scale(0.6); transition: transform 3.5s ease-in-out; flex-shrink: 0; }
.moon-ring.in { transform: scale(1.2); }

/* Section splash */
.splash { text-align: center; padding-top: 3rem; }
.splash-icon { font-size: 4.5rem; animation: float 2.4s ease-in-out infinite; }
.splash h2 { font-size: 2.2rem; margin-top: 0.6rem; }
.splash p { max-width: 32ch; margin: 0.6rem auto 2rem; font-size: 1.15rem; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* Breathing */
.bubble { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.8rem auto 0; max-width: 520px; text-align: left; }
.bubble > span { flex-shrink: 0; }
.bubble p { background: #fff; border-radius: 4px 20px 20px 20px; padding: 0.8rem 1rem; box-shadow: 0 4px 16px rgba(11, 27, 59, 0.07); font-size: 1rem; }
.breathe-stage { width: 230px; height: 230px; margin: 1.6rem auto 0.8rem; }
.breathe-ring { background: radial-gradient(circle, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0.08)); }
.breathe-core { position: relative; }
.breathe-cue { font-size: 1.5rem; }
.breathe-count { font-family: var(--display); font-size: 2.6rem; font-weight: 700; color: var(--midnight); min-height: 3.2rem; line-height: 1.2; }
.breath-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.4rem; }
.breath-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background 0.3s; }
.breath-dots i.on { background: var(--teal); }

/* Learn cards */
.big-question {
  display: flex; gap: 0.8rem; align-items: center; margin-top: 0.6rem; padding: 0.9rem 1.1rem; border-radius: 20px;
  background: var(--midnight); color: #fff; font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.3;
}
.big-question > span:first-child { font-size: 1.8rem; }
.big-question small { display: block; font-family: var(--body); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sunshine); }
.flip { margin-top: 1rem; }
.flip-inner { min-height: 0; }
.learn-front, .learn-back {
  display: block; text-align: left; padding: 1.3rem; border-radius: 26px; background: #fff;
  box-shadow: 0 2px 0 rgba(11, 27, 59, 0.06), 0 12px 34px rgba(11, 27, 59, 0.08);
}
.learn-back { transform: rotateY(180deg); box-shadow: inset 0 0 0 3px var(--purple), 0 12px 34px rgba(139, 92, 246, 0.18); }
.learn-head { display: flex; align-items: center; gap: 0.7rem; }
.learn-head h3 { font-size: 1.5rem; }
.learn-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #EEE8FE; font-size: 1.5rem; flex-shrink: 0; }
.learn-points { margin: 1rem 0 0; padding: 0; list-style: none; }
.learn-points li { position: relative; padding-left: 1.8rem; margin-top: 0.55rem; }
.learn-points li::before { content: "★"; position: absolute; left: 0; color: var(--sunshine); }
.learn-example { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 16px; background: rgba(59, 130, 246, 0.08); }
.learn-example strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--blue); }
.learn-tip { display: flex; gap: 0.5rem; margin-top: 0.8rem; padding: 0.8rem 1rem; border-radius: 16px; background: #FFF7DF; font-weight: 700; }
.learn-front > .btn { margin-top: 1.2rem; }

/* Visuals */
.vis { margin-top: 1rem; padding: 1rem; border-radius: 18px; background: var(--paper); overflow-x: auto; text-align: center; }
.vis-svg { width: 100%; height: auto; display: block; margin: 0 auto; }
.vis-caption { margin-top: 0.6rem; font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.pop-in { animation: pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; transform-origin: center; transform-box: fill-box; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
.draw-in { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 0.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.spin-slow { animation: spin 8s linear infinite; transform-box: view-box; }
@keyframes spin { to { transform: rotate(360deg); } }
.vis-sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; }
.vis-sentence .word { display: inline-flex; flex-direction: column; align-items: center; padding: 0.35rem 0.6rem; border-radius: 12px; background: #fff; font-weight: 800; font-size: 1.15rem; }
.vis-sentence .word.tagged { background: var(--tag); color: #fff; animation: pop-in 0.45s both; }
.vis-sentence .word small { font-size: 0.7rem; font-weight: 800; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.05em; }
.vis-label { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.4rem; }
.vis-arrow { font-size: 1.4rem; margin: 0.4rem 0; color: var(--purple); }
.vis-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
.vis-icon { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.8rem 0.5rem; border-radius: 16px; background: #fff; line-height: 1.3; }
.vis-icon .e { font-size: 1.8rem; font-weight: 800; color: var(--purple); }
.vis-icon span:not(.e) { font-size: 0.85rem; color: var(--muted); }
.vis-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.vis-side { padding: 0.9rem; border-radius: 16px; background: #fff; box-shadow: inset 0 4px 0 var(--tag); text-align: left; }
.vis-side strong { color: var(--tag); font-family: var(--display); font-size: 1.2rem; }
.vis-side .ex { margin-top: 0.4rem; font-weight: 800; }
.vis-equations p { font-family: var(--display); font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 700; margin: 0.3rem 0; }
.vis-equations small { display: block; font-family: var(--body); font-size: 0.85rem; color: var(--teal); font-weight: 800; }
.vis-timeline { list-style: none; margin: 0; padding: 0; text-align: left; position: relative; }
.vis-timeline::before { content: ""; position: absolute; left: 4.6rem; top: 0.4rem; bottom: 0.4rem; width: 3px; background: var(--line); border-radius: 3px; }
.vis-timeline li { display: grid; grid-template-columns: 3.8rem 2rem 1fr; gap: 0.5rem; align-items: center; padding: 0.35rem 0; font-size: 0.95rem; }
.vis-timeline .yr { font-weight: 800; color: var(--purple); text-align: right; }
.vis-timeline .e { position: relative; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #fff; }
.vis-flow { display: flex; align-items: center; justify-content: center; gap: 0.4rem; flex-wrap: wrap; }
.vis-flow .vis-icon { min-width: 100px; max-width: 150px; }
.vis-flow-arrow { font-size: 1.5rem; color: var(--purple); font-weight: 800; }

/* Hype summary */
.trophy { font-size: 3.6rem; animation: float 2.4s ease-in-out infinite; }
.summary .avatar { margin-top: 0.4rem; }
.xp-total { display: inline-flex; align-items: baseline; gap: 0.5rem; margin-top: 1rem; padding: 0.6rem 1.4rem; border-radius: 999px; background: var(--sunshine); font-weight: 800; }
.xp-total b { font-family: var(--display); font-size: 2.4rem; }
.level-card { margin: 1.2rem auto 0; max-width: 420px; padding: 1rem 1.2rem; border-radius: 20px; background: #fff; text-align: left; box-shadow: 0 6px 20px rgba(11, 27, 59, 0.06); }
.level-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; }
.level-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.5rem; }
.level-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--blue)); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.level-up { margin-top: 0.7rem; font-weight: 800; color: var(--purple); animation: pop 0.5s ease; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.2rem auto 0; max-width: 460px; }
.summary-stats div { padding: 0.8rem 0.4rem; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(11, 27, 59, 0.05); }
.summary-stats b { display: block; font-family: var(--display); font-size: 1.5rem; }
.summary-stats span { font-size: 0.8rem; color: var(--muted); line-height: 1.3; display: block; }
.sticker { animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

/* Confetti and floating XP */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: 0.9; } }
.float-xp {
  position: absolute; z-index: 60; transform: translateX(-50%); pointer-events: none; font-family: var(--display);
  font-weight: 700; font-size: 1.4rem; color: #B7791F; text-shadow: 0 2px 0 #fff; animation: rise 1.1s ease-out forwards;
}
@keyframes rise { from { opacity: 0; translate: 0 0; } 20% { opacity: 1; } to { opacity: 0; translate: 0 -70px; } }

/* Kids home: player card */
.player {
  display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 24px;
  background: linear-gradient(135deg, var(--midnight), #1E2F6B); color: #fff;
}
.player .kid-chip { width: 56px; height: 56px; font-size: 1.6rem; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.player-main { flex: 1; min-width: 0; }
.player-main strong { font-family: var(--display); font-size: 1.15rem; }
.player .level-bar { background: rgba(255, 255, 255, 0.2); height: 10px; }
.player small { display: block; margin-top: 0.3rem; font-size: 0.8rem; opacity: 0.85; }
.player-streak { text-align: center; font-weight: 800; line-height: 1.2; }
.player-streak b { display: block; font-family: var(--display); font-size: 1.5rem; }
.subject-tile .icon { background: var(--tile, var(--purple)); }
.subject-tile { box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); }
.subject-tile:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--purple), 0 1px 0 var(--line); }

/* Kid login */
.login-card { width: min(100%, 380px); margin-top: 1.8rem; padding: 1.4rem; border-radius: 24px; background: #fff; color: var(--midnight); text-align: left; }
.login-card .input { font-size: 1.2rem; }
.login-card .msg { margin-top: 0.8rem; }

/* Character life */
.avatar.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }

/* Breathing: pulsing glow around Remy */
.breathe-core .avatar { box-shadow: 0 0 0 4px #fff, 0 0 30px 8px rgba(59, 130, 246, 0.55); animation: glow 2.2s ease-in-out infinite; }
@keyframes glow {
  50% { box-shadow: 0 0 0 4px #fff, 0 0 60px 26px rgba(20, 184, 166, 0.55); }
}
.breathe-ring { box-shadow: 0 0 60px 10px rgba(59, 130, 246, 0.25); }
.breathe-ring.in { box-shadow: 0 0 90px 30px rgba(20, 184, 166, 0.35); }

/* Lesson time chat */
.teach-head { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.teach-head strong { display: block; font-family: var(--display); font-size: 1.2rem; }
.teach-head span { font-size: 0.85rem; color: var(--muted); }
.chat { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1rem; padding-bottom: 1rem; }
.cmsg { display: flex; gap: 0.6rem; align-items: flex-end; animation: enter 0.3s ease both; }
.cmsg-me { justify-content: flex-end; }
.bubble-body {
  max-width: 88%; padding: 0.9rem 1.1rem; border-radius: 22px 22px 22px 6px; background: #fff;
  box-shadow: 0 4px 18px rgba(11, 27, 59, 0.07);
}
.cmsg-me .bubble-body { background: var(--blue); color: #fff; border-radius: 22px 22px 6px 22px; font-weight: 800; }
.bubble-body p + p, .bubble-body p + .vis, .bubble-body .vis + p { margin-top: 0.6rem; }
.bubble-body.good { background: #E7F8F6; box-shadow: inset 0 0 0 2px var(--teal); }
.bubble-body.warn { background: #FFF1E6; box-shadow: inset 0 0 0 2px var(--orange); }
.bubble-body.turn { box-shadow: inset 0 0 0 3px var(--purple), 0 8px 24px rgba(139, 92, 246, 0.2); width: 88%; }
.bubble-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.bq { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.3; }
.bq small { display: block; font-family: var(--body); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple); }
.typing { display: flex; gap: 0.3rem; padding: 1rem 1.2rem; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: #B9C1D3; animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 50% { transform: translateY(-5px); background: var(--purple); } }
.chat-example { padding: 0.2rem 0; }
.chat-example strong, .chat-tip strong { color: var(--blue); }
.chat-tip { display: flex; gap: 0.5rem; background: #FFF7DF; margin: -0.9rem -1.1rem; padding: 0.9rem 1.1rem; border-radius: inherit; font-weight: 700; }
.chat-tip strong { color: #B7791F; }
.chat-controls { position: sticky; bottom: 0; display: flex; gap: 0.6rem; align-items: center; padding: 0.8rem 0 calc(0.8rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--paper) 30%); }
.chat-controls .grow { flex: 1; }
.read-icon.static { position: static; flex-shrink: 0; }
.options.compact { margin-top: 0.8rem; gap: 0.6rem; }
.options.compact .option { font-size: 1.05rem; padding: 0.75rem 0.9rem; }
.bubble-body .vis { background: var(--paper); }

/* Cheat sheet */
.cheat { margin: 1.6rem auto 0; max-width: 520px; padding: 1.2rem; border-radius: 24px; background: #fff; text-align: left; box-shadow: 0 6px 20px rgba(11, 27, 59, 0.06); }
.cheat-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.cheat-item { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.cheat-item strong { color: var(--purple); font-family: var(--display); font-size: 1.1rem; }
.cheat-tip { font-weight: 800; color: #B7791F; margin-top: 0.3rem; }
.cheat .btn { margin-top: 1rem; }

/* Colourful subject tiles */
.subject-tile.coloured {
  color: #fff; background: linear-gradient(140deg, var(--c1), var(--c2)); box-shadow: 0 6px 0 var(--c3), 0 14px 30px -10px var(--c2);
  overflow: hidden; min-height: 160px;
}
.subject-tile.coloured::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.subject-tile.coloured:hover { transform: translateY(-3px) rotate(-0.5deg); box-shadow: 0 8px 0 var(--c3), 0 18px 34px -10px var(--c2); }
.subject-tile.coloured:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c3); }
.subject-tile.coloured .icon { background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(4px); font-size: 1.7rem; }
.subject-tile.coloured .level { color: rgba(255, 255, 255, 0.85); }
.subject-tile .tile-progress { margin-top: auto; width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.subject-tile .tile-progress span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.subject-tile .badge { position: absolute; top: 0.8rem; right: 0.8rem; z-index: 1; }

/* Continue card */
.continue {
  display: flex; align-items: center; gap: 1rem; width: 100%; margin-top: 1rem; padding: 1rem 1.1rem; border: 0; text-align: left;
  border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 3px var(--sunshine), 0 8px 24px rgba(251, 191, 36, 0.25);
}
.continue small { display: block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #B7791F; }
.continue strong { font-family: var(--display); font-size: 1.25rem; line-height: 1.25; }
.continue .go-btn { margin-left: auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--sunshine); font-size: 1.4rem; flex-shrink: 0; }
.section-title { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin-top: 1.8rem; }

/* Gateway with personality */
.gateway { padding-top: 1.5rem; }
.gateway::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5) 1px, transparent 2px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.4) 1px, transparent 2px), radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.35) 1px, transparent 2px);
  background-size: 120px 120px, 180px 180px, 150px 150px; animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.4; } }
.crew-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0.2rem; margin-top: 1.4rem; }
.crew-stage .avatar { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 10px 30px rgba(0, 0, 0, 0.35); }
.crew-stage .mid { transform: translateY(-14px); }
.crew-stage .a1 { animation: bob 2.8s ease-in-out infinite; }
.crew-stage .a2 { animation: bob 2.4s ease-in-out 0.3s infinite; }
.crew-stage .a3 { animation: bob 3s ease-in-out 0.6s infinite; }
.speech {
  position: relative; max-width: 330px; margin: 1.2rem auto 0; padding: 0.9rem 1.1rem; border-radius: 22px; background: #fff;
  color: var(--midnight); font-weight: 800; font-size: 1.05rem; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.speech::before { content: ""; position: absolute; top: -10px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: #fff; }
.speech small { display: block; font-size: 0.8rem; color: var(--purple); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.4rem; }
.stat-chips span { padding: 0.45rem 0.9rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(6px); font-weight: 800; font-size: 0.95rem; }
.mission {
  display: flex; gap: 0.8rem; align-items: center; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 18px; max-width: 360px;
  background: rgba(251, 191, 36, 0.14); box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.6); text-align: left; font-size: 0.95rem;
}
.mission b { color: var(--sunshine); display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.gateway .tap-enter { margin-top: 1.6rem; }
.gateway h1 { margin-top: 1.2rem; }
.login-card h2 { font-size: 1.5rem; }
.login-card .btn { margin-top: 1.2rem; }
.parent-link { margin-top: 1.2rem; color: rgba(255, 255, 255, 0.75); font-weight: 700; font-size: 0.95rem; }
.parent-link a { color: #fff; }

@media (max-width: 460px) {
  .path { gap: 0.2rem; }
  .path li { width: 28px; height: 28px; font-size: 0.85rem; }
  .xp-pill, .combo { padding: 0.25rem 0.55rem; font-size: 0.85rem; }
  .lesson-top .icon-btn { width: 40px; height: 40px; }
}

/* =====================================================================
   Lesson time as slides: Sage + whiteboard, no scrolling
   ===================================================================== */
.lesson:has(.teach2) { max-width: 1100px; }
.teach2 { display: flex; flex-direction: column; min-height: calc(100dvh - 150px); }
.teach-grid { flex: 1; display: grid; gap: 1rem; margin-top: 0.6rem; grid-template-rows: auto 1fr; min-height: 0; }
.tutor { display: flex; gap: 0.8rem; align-items: flex-start; }
.tutor-face { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tutor-face .avatar { width: 64px !important; height: 64px !important; box-shadow: 0 0 0 4px #fff, 0 6px 18px rgba(249, 115, 22, 0.35); }
.tutor-name { font-family: var(--display); font-weight: 700; font-size: 0.9rem; color: var(--orange); margin-top: 0.2rem; }
.tutor-bubble {
  position: relative; flex: 1; display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.85rem 1rem;
  border-radius: 6px 22px 22px 22px; background: #fff; box-shadow: 0 6px 20px rgba(11, 27, 59, 0.08); font-weight: 700;
}
.tutor-bubble p { flex: 1; }
.tutor-bubble .read-icon { width: 38px; height: 38px; font-size: 1rem; }
.tutor-bubble.pop { animation: pop 0.3s ease; }
.board {
  position: relative; overflow: auto; border-radius: 28px; padding: 1.3rem; background: #fff;
  box-shadow: 0 2px 0 rgba(11, 27, 59, 0.05), 0 16px 40px rgba(11, 27, 59, 0.08);
  background-image: radial-gradient(rgba(11, 27, 59, 0.05) 1px, transparent 1px); background-size: 22px 22px;
}
.board-in { animation: slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.board-in.from-left { animation-name: slide-in-left; }
@keyframes slide-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.board-big { text-align: center; padding: 1rem 0; }
.board-big .board-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; background: #EEE8FE; font-size: 2.6rem; animation: float 2.4s ease-in-out infinite; }
.board-big small, .board-example small, .board-tip small {
  display: block; margin-top: 0.9rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--purple);
}
.board-big h2 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin-top: 0.3rem; }
.board-title { font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.board .vis { margin-top: 0.8rem; background: var(--paper); }
.board-point { display: flex; gap: 0.8rem; align-items: flex-start; margin-top: 1rem; font-size: clamp(1.15rem, 3vw, 1.4rem); font-weight: 700; line-height: 1.55; }
.board-point .num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sunshine); font-family: var(--display); flex-shrink: 0; }
.board-example { padding: 1.4rem; border-radius: 22px; background: rgba(59, 130, 246, 0.08); }
.board-example small { margin-top: 0; color: var(--blue); }
.board-example p { margin-top: 0.4rem; font-size: clamp(1.2rem, 3.4vw, 1.6rem); font-weight: 700; line-height: 1.5; }
.board-tip { position: relative; padding: 1.6rem 1.4rem 1.4rem; border-radius: 8px; background: #FFF1B8; transform: rotate(-1.5deg); box-shadow: 0 12px 26px rgba(183, 121, 31, 0.25); text-align: center; }
.board-tip > span { position: absolute; top: -18px; left: 50%; margin-left: -18px; font-size: 2rem; }
.board-tip small { margin-top: 0; color: #B7791F; }
.board-tip p { margin-top: 0.4rem; font-family: var(--display); font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 700; line-height: 1.35; }
.board-q { font-size: clamp(1.3rem, 3.6vw, 1.8rem); margin-top: 0.4rem; }
.board-feedback { margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 16px; font-weight: 700; animation: pop 0.35s ease; }
.board-feedback.good { background: #E7F8F6; color: #0F766E; }
.board-feedback.warn { background: #FFF1E6; color: #9A3412; }
.teach-nav { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px)); }
.teach-nav [data-next] { margin-left: auto; min-width: 150px; }
.teach-nav .btn:disabled { opacity: 0.35; }
.slide-dots { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: center; flex: 1; }
.slide-dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--line); transition: all 0.25s; }
.slide-dots i.done { background: var(--purple); opacity: 0.45; }
.slide-dots i.on { width: 24px; background: var(--purple); }

/* Tablet and laptop: Sage beside the whiteboard */
@media (min-width: 820px) {
  .teach-grid { grid-template-columns: 260px 1fr; grid-template-rows: 1fr; gap: 1.5rem; }
  .tutor { flex-direction: column; align-items: center; text-align: center; padding-top: 1rem; }
  .tutor-face .avatar { width: 140px !important; height: 140px !important; }
  .tutor-name { font-size: 1.1rem; }
  .tutor-bubble { border-radius: 22px; flex-direction: column; align-items: center; font-size: 1.05rem; }
  .tutor-bubble::before { content: ""; position: absolute; top: -10px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: #fff; }
  .board { padding: 2rem; }
  .board .vis { padding: 1.4rem; }
}

/* Short phone screens: tighter */
@media (max-height: 700px) and (max-width: 819px) {
  .tutor-face .avatar { width: 48px !important; height: 48px !important; }
  .tutor-bubble { padding: 0.6rem 0.8rem; font-size: 0.95rem; }
  .board { padding: 1rem; }
}

/* Wider screens for questions and practice too */
@media (min-width: 820px) {
  .lesson { max-width: 820px; }
  .options:not(.compact) { grid-template-columns: 1fr 1fr; }
  .prompt { font-size: 2.1rem; }
  .sheet-inner { max-width: 820px; }
}
@media (min-width: 820px) and (max-width: 1100px) {
  .lesson:has(.teach2) { max-width: 100%; padding-left: 2rem; padding-right: 2rem; }
}

/* Phones: whiteboard scrolls inside itself so Back and Next are always on screen */
@media (max-width: 819px) {
  .teach2 { height: calc(100dvh - 105px); min-height: 0; }
  .teach-grid { min-height: 0; overflow: hidden; }
  .board { min-height: 0; }
  .slide-dots { flex-wrap: nowrap; gap: 0.25rem; }
  .slide-dots i { width: 7px; height: 7px; }
  .slide-dots i.on { width: 18px; }
  .teach-nav [data-next] { min-width: 130px; }
}
@media (min-width: 820px) {
  .tutor { align-self: start; }
  .tutor-bubble { flex: 0 0 auto; width: 100%; }
}

/* =====================================================================
   Parent Portal dashboard
   ===================================================================== */
.page:has(.dash-tabs) { max-width: 1080px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.dash-head h1 { margin-top: 1.6rem; }
.kid-switch { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.kid-switch button {
  display: inline-flex; align-items: center; gap: 0.6rem; border: 0; border-radius: 999px; padding: 0.35rem 1rem 0.35rem 0.35rem;
  background: #fff; font-weight: 800; box-shadow: inset 0 0 0 2px var(--line);
}
.kid-switch button[aria-selected="true"] { box-shadow: inset 0 0 0 3px var(--purple); background: #F5F1FF; }
.kid-switch .kid-chip { box-shadow: none; }
.dash-tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; gap: 0.3rem; margin-top: 1.2rem; padding: 0.35rem;
  border-radius: 18px; background: #fff; box-shadow: 0 4px 18px rgba(11, 27, 59, 0.06); overflow-x: auto;
}
.dash-tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; white-space: nowrap;
  border: 0; border-radius: 14px; padding: 0.75rem 1rem; background: none; font-weight: 800; color: var(--muted);
}
.dash-tabs button[aria-selected="true"] { background: var(--midnight); color: #fff; }
[data-tab] { margin-top: 1.4rem; }
[data-tab] > * + * { margin-top: 1rem; }
.dash-section { font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin-top: 1.6rem; }
.dash-empty { text-align: center; padding: 2.5rem 1.5rem; }
.dash-empty h2 { margin-top: 1rem; }
.dash-empty .lead { margin: 0.5rem auto 1.4rem; }

.hero-kid { display: flex; gap: 1rem; align-items: center; padding: 1.3rem; border-radius: 24px; background: linear-gradient(135deg, var(--midnight), #1E2F6B); color: #fff; }
.hero-kid h2 { font-size: 1.7rem; }
.hero-kid p { opacity: 0.85; margin-top: 0.2rem; }
.hero-kid-main { flex: 1; }
.hero-kid .level-bar { background: rgba(255, 255, 255, 0.2); margin-top: 0.7rem; }
.hero-kid .kid-chip { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; }
.stat-grid.small { margin-top: 1rem; }
.stat-tile { display: flex; flex-direction: column; gap: 0.15rem; padding: 1rem 1.1rem; border-radius: 20px; background: #fff; box-shadow: 0 1px 0 rgba(11, 27, 59, 0.06); }
.stat-tile span { font-size: 1.4rem; }
.stat-tile b { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; }
.stat-tile small { color: var(--muted); font-weight: 700; font-size: 0.85rem; line-height: 1.3; }
.journey-top .stat-tile { background: var(--paper); }

.subject-row { display: flex; gap: 0.9rem; align-items: center; padding: 0.7rem 0; }
.subject-row + .subject-row { border-top: 1px solid var(--line); }
.subject-dot { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-size: 1.2rem; flex-shrink: 0; }
.subject-row-main { flex: 1; min-width: 0; }
.subject-row .meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.subject-row .meta span { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.subject-row .bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.4rem; }
.subject-row .bar span { display: block; height: 100%; border-radius: 999px; }
.two-col { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plain-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.plain-list li { padding: 0.5rem 0; border-top: 1px solid var(--line); font-weight: 700; }
.plain-list li:first-child { border-top: 0; }
.plain-list li span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.tip-card { padding: 1.1rem 1.3rem; border-radius: 20px; background: #FFF7DF; box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.5); }
.tip-card strong { color: #B7791F; }
.tip-card p { margin-top: 0.3rem; }

/* Journey map: a winding path of lessons */
.journey-map { position: relative; margin-top: 1.2rem; padding: 0.5rem 0 1rem; }
.journey-map::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 6px;
  background: repeating-linear-gradient(to bottom, var(--purple) 0 14px, transparent 14px 26px); opacity: 0.35;
}
.j-day { position: relative; }
.j-day-label { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin: 1.4rem auto 0.6rem; width: max-content; padding: 0.45rem 1.1rem; border-radius: 999px; background: var(--midnight); color: #fff; text-align: center; }
.j-day-label span { font-family: var(--display); font-weight: 600; }
.j-day-label small { font-size: 0.75rem; opacity: 0.8; }
.j-step { position: relative; display: flex; margin: 0.8rem 0; }
.j-step.left { justify-content: flex-start; padding-right: calc(50% + 1.2rem); }
.j-step.right { justify-content: flex-end; padding-left: calc(50% + 1.2rem); }
.j-step::after { content: ""; position: absolute; top: 1.6rem; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--sunshine); box-shadow: 0 0 0 4px #fff; }
.j-card { display: flex; gap: 0.8rem; width: 100%; padding: 1rem; border-radius: 20px; background: #fff; box-shadow: 0 6px 20px rgba(11, 27, 59, 0.07); text-align: left; }
.j-node { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.3rem; flex-shrink: 0; }
.j-body { flex: 1; min-width: 0; }
.j-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.j-meta { font-size: 0.85rem; color: var(--muted); }
.j-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.j-chips span { padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--paper); font-size: 0.82rem; font-weight: 800; }
.j-help { margin-top: 0.5rem; font-size: 0.9rem; }
.j-help summary { cursor: pointer; font-weight: 800; color: var(--orange); }
.j-help ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.j-stickers { margin-top: 0.4rem; font-size: 0.85rem; color: var(--purple); font-weight: 700; }
.j-card .link-btn { margin-top: 0.6rem; font-size: 0.9rem; }
.j-start { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; margin-top: 1.4rem; font-weight: 800; color: var(--muted); }
@media (max-width: 720px) {
  .journey-map::before { left: 23px; }
  .j-step.left, .j-step.right { padding: 0 0 0 3.2rem; justify-content: flex-start; }
  .j-step::after { left: 23px; }
  .j-day-label { margin-left: 0; }
}

/* Report */
.report-tools { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; justify-content: space-between; }
.report-sheet { padding: 1.6rem; border-radius: 26px; background: #fff; box-shadow: 0 10px 34px rgba(11, 27, 59, 0.08); }
.report-sheet h3 { font-size: 1.3rem; margin-top: 1.8rem; }
.report-sheet .stat-tile { background: var(--paper); }
.report-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin: -1.6rem -1.6rem 1.4rem; padding: 1.6rem; border-radius: 26px 26px 0 0; background: var(--midnight); color: #fff; }
.report-head h2 { font-size: 1.7rem; }
.report-head p { opacity: 0.85; }
.report-brand { font-family: var(--display); font-weight: 700; color: var(--sunshine) !important; opacity: 1 !important; letter-spacing: 0.08em; }
.report-table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; font-size: 0.95rem; }
.report-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.5rem; border-bottom: 2px solid var(--line); }
.report-table td { padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table small { color: var(--muted); }
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-weight: 800; font-size: 0.82rem; background: color-mix(in srgb, var(--pill) 22%, white); box-shadow: inset 0 0 0 1.5px var(--pill); }
.report-notes { margin-top: 1.4rem; display: grid; gap: 0.4rem; }
.report-sheet .tip-card { margin-top: 1.2rem; }
@media (max-width: 640px) {
  .report-sheet { padding: 1.1rem; }
  .report-head { margin: -1.1rem -1.1rem 1.2rem; padding: 1.2rem; }
  .report-table thead { display: none; }
  .report-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .report-table td { border: 0; padding: 0.1rem 0; }
  .report-table td:first-child { grid-column: 1 / -1; font-weight: 800; }
}

/* Kids & logins */
.kids-manage { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.login-box { padding: 0.8rem 1rem; border-radius: 16px; background: #F5F1FF; }
.login-box strong { color: var(--purple); font-size: 1.1rem; }
.danger-zone { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.link-btn.danger { color: #C2410C; }
.add-panel { background: linear-gradient(135deg, #F5F1FF, #fff); box-shadow: inset 0 0 0 2px #E4DAFD; }

@media print {
  body { background: #fff; }
  .page > *:not([data-tab]), .report-tools, .top-bar { display: none !important; }
  [data-tab] > *:not(.report-sheet) { display: none !important; }
  .report-sheet { box-shadow: none; padding: 0; }
  .report-head { margin: 0 0 1rem; border-radius: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pill, .tip-card, .stat-tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =====================================================================
   Kids home v3: mission + two folders, Exam Prep, Exam Room, Blueprint
   ===================================================================== */
.page-title { font-size: clamp(1.8rem, 6vw, 2.4rem); margin-top: 1.4rem; }
.kids-home { max-width: 880px; }
.mission-card { margin-top: 1rem; padding: 1.1rem 1.2rem; border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 3px var(--sunshine), 0 10px 26px rgba(251, 191, 36, 0.18); }
.mission-head { display: flex; align-items: center; gap: 0.8rem; }
.mission-head > span { font-size: 1.9rem; }
.mission-head strong { display: block; font-family: var(--display); font-size: 1.3rem; }
.mission-head small { color: var(--muted); font-weight: 700; }
.mission-head > div:nth-child(2) { flex: 1; }
.mission-ring { --p: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--line) 0); }
.mission-ring span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; font-weight: 800; font-size: 0.9rem; }
.mission-list { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.mission-list button { display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; border: 0; padding: 0.75rem 0.9rem; border-radius: 16px; background: var(--paper); font-weight: 800; }
.mission-list button:not(:disabled):hover { background: #F5F1FF; }
.mission-list .tick-box { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px #CBD2E0; flex-shrink: 0; color: #fff; }
.mission-list li.done .tick-box { background: var(--teal); box-shadow: none; }
.mission-list li.done .m-text { text-decoration: line-through; color: var(--muted); }
.mission-list .m-text { flex: 1; line-height: 1.35; }
.mission-list .go { color: var(--purple); }
.mission-done { margin-top: 0.8rem; font-weight: 800; color: #0F766E; }
.folders { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.folder {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-height: 200px; padding: 1.3rem;
  border: 0; border-radius: 8px 26px 26px 26px; text-align: left; color: #fff; overflow: visible; margin-top: 18px;
  transition: transform 0.15s;
}
.folder:hover { transform: translateY(-3px) rotate(-0.4deg); }
.folder:active { transform: translateY(3px); }
.folder-tab { position: absolute; top: -18px; left: 0; width: 42%; height: 26px; border-radius: 14px 14px 0 0; background: inherit; }
.folder-journey { background: linear-gradient(140deg, #3B82F6, #8B5CF6); box-shadow: 0 8px 0 #4C1D95, 0 18px 36px -12px #6D28D9; }
.folder-exam { background: linear-gradient(140deg, #14B8A6, #0F766E); box-shadow: 0 8px 0 #115E59, 0 18px 36px -12px #0D9488; }
.folder-icon { font-size: 2.6rem; }
.folder strong { font-family: var(--display); font-size: 1.7rem; }
.folder small { opacity: 0.9; font-weight: 700; line-height: 1.4; max-width: 30ch; }
.folder-crew { position: absolute; right: 1rem; bottom: 1rem; display: flex; }
.folder-crew .avatar { width: 40px !important; height: 40px !important; margin-left: -10px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9); }
.lesson-card.locked { opacity: 0.6; cursor: not-allowed; background: var(--paper); }

.exam-grid { display: grid; gap: 0.7rem; margin-top: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.exam-tile { display: flex; align-items: center; gap: 0.9rem; width: 100%; border: 0; text-align: left; padding: 1rem; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); }
.exam-tile:hover { box-shadow: inset 0 0 0 2px var(--teal), 0 4px 0 #A7E9E1; }
.exam-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 1.6rem; flex-shrink: 0; }
.exam-main { flex: 1; min-width: 0; }
.exam-main strong { display: block; font-family: var(--display); font-size: 1.15rem; }
.exam-main small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.countdown { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 0.4rem; border-radius: 14px; background: var(--paper); font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.countdown b { font-family: var(--display); font-size: 1.4rem; color: var(--midnight); line-height: 1.1; }
.countdown.soon { background: #FFF1E6; }
.countdown.soon b { color: var(--orange); }
.exam-tile .go, .exam-start .go-btn { color: var(--teal); }
.exam-upload { background: linear-gradient(135deg, #E7F8F6, #fff); box-shadow: inset 0 0 0 2px #A7E9E1; }
.upload-btn { margin-top: 1rem; cursor: pointer; }
.reading { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; font-weight: 800; color: var(--purple); }
.cover-list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.cover-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.cover-list li:first-child { border-top: 0; }
.c-main { flex: 1; min-width: 0; }
.c-main strong { display: block; line-height: 1.3; }
.c-main small { font-weight: 800; }
.soon-tag { color: var(--muted); font-size: 0.8rem; }
.plan-notes { margin-top: 1rem; padding: 0.9rem 1.1rem; border-radius: 16px; background: #FFF7DF; }
.plan-notes.marks { background: #EEF4FF; }
.plan-notes ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.exam-start { display: flex; align-items: center; gap: 1rem; width: 100%; margin-top: 1rem; padding: 1.2rem; border: 0; text-align: left; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--midnight), #1E3A8A); box-shadow: 0 6px 0 #050D1F; }
.exam-start > span:first-child { font-size: 2.2rem; }
.exam-start strong { display: block; font-family: var(--display); font-size: 1.3rem; }
.exam-start small { opacity: 0.85; }
.exam-start .go-btn { margin-left: auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1.3rem; flex-shrink: 0; }
.topic-group { border: 0; margin: 1rem 0 0; padding: 1rem; border-radius: 20px; background: #fff; }
.topic-group legend { font-family: var(--display); font-weight: 600; font-size: 1.1rem; padding: 0; float: left; width: 100%; margin-bottom: 0.4rem; }
.topic-check { display: flex; gap: 0.7rem; align-items: center; padding: 0.55rem 0; border-top: 1px solid var(--line); clear: both; }
.topic-check input { width: 24px; height: 24px; accent-color: var(--teal); flex-shrink: 0; }

/* Exam Room */
.exam-title { flex: 1; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.option.picked { background: #EEF4FF; box-shadow: inset 0 0 0 3px var(--blue), 0 4px 0 #BFD4FB; }
.option.picked .letter { background: var(--blue); color: #fff; }
.exam-nav { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.6rem; flex-wrap: wrap; }
.exam-nav [data-nextq] { margin-left: auto; }
.q-dots { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; flex: 1; }
.q-dots button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--line); font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.q-dots button.answered { background: var(--blue); color: #fff; }
.q-dots button.on { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.45); }
.q-dots.big { margin: 1.4rem auto 0; max-width: 360px; }
.q-dots.big button { width: 40px; height: 40px; font-size: 1rem; }
.marking { position: relative; display: inline-block; }
.marking .pen { position: absolute; right: -14px; bottom: 0; font-size: 2rem; animation: write 0.6s ease-in-out infinite alternate; }
@keyframes write { to { transform: translate(-8px, -6px) rotate(-12deg); } }
.mark-ticks { display: flex; justify-content: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 1.4rem; }
.mark-ticks i { width: 22px; height: 22px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
.mark-ticks i.right { background: var(--teal); transform: scale(1.15); }
.mark-ticks i.wrong { background: var(--orange); transform: scale(1.15); }

/* Your Blueprint: corrections, the friendly way */
.blueprint { padding-bottom: 2rem; }
.bp-head {
  position: relative; overflow: hidden; margin-top: 0.6rem; padding: 1.6rem 1.4rem; border-radius: 28px; color: #fff; text-align: center;
  background-color: #1E3A8A;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.bp-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: #93C5FD; }
.bp-score { display: flex; align-items: baseline; justify-content: center; gap: 0.4rem; margin-top: 0.4rem; font-family: var(--display); }
.bp-score b { font-size: 4rem; line-height: 1; }
.bp-score span:last-child { font-size: 1.6rem; opacity: 0.8; }
.bp-emoji { font-size: 2.6rem; align-self: center; }
.bp-head h2 { font-size: 1.8rem; margin-top: 0.4rem; }
.bp-head p { opacity: 0.9; max-width: 44ch; margin: 0.3rem auto 0; }
.bp-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.bp-chips span { padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 800; font-size: 0.9rem; }
.bp-h { font-size: 1.3rem; margin-top: 1.6rem; }
.bp-topics { display: grid; gap: 0.6rem; margin-top: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bp-topic { padding: 0.9rem 1rem; border-radius: 18px; background: #fff; }
.bp-topic .meta { display: flex; justify-content: space-between; gap: 0.8rem; font-weight: 800; }
.bp-topic .bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.4rem; }
.bp-topic .bar span { display: block; height: 100%; border-radius: 999px; }
.bp-topic small { color: var(--muted); font-weight: 700; }
.bp-filter { margin-top: 0.8rem; }
.bp-list { display: grid; gap: 0.8rem; margin-top: 0.8rem; }
.bp-q { padding: 1.1rem 1.2rem; border-radius: 22px; background: #fff; box-shadow: inset 4px 0 0 var(--teal); }
.bp-q.fix { box-shadow: inset 4px 0 0 var(--orange); }
.bp-q-head { display: flex; align-items: center; gap: 0.6rem; }
.bp-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--paper); font-weight: 800; }
.bp-tag { font-weight: 800; font-size: 0.95rem; }
.bp-q.right .bp-tag { color: #0F766E; }
.bp-q.fix .bp-tag { color: #C2410C; }
.bp-prompt { margin-top: 0.5rem; font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.4; }
.bp-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6rem; margin-top: 0.7rem; }
.bp-answers > div { padding: 0.7rem 0.9rem; border-radius: 14px; }
.bp-answers small { display: block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.bp-answers p { font-weight: 800; margin-top: 0.15rem; }
.bp-answers .yours { background: #FFF1E6; }
.bp-answers .yours small { color: #C2410C; }
.bp-answers .good { background: #E7F8F6; }
.bp-answers .good small { color: #0F766E; }
.bp-how { margin-top: 0.7rem; }
.bp-how summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 800; color: var(--orange); list-style: none; }
.bp-how summary::-webkit-details-marker { display: none; }
.bp-how .avatar { width: 28px !important; height: 28px !important; box-shadow: none; }
.bp-note { margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 16px; background: #F5F1FF; font-weight: 700; }

/* Phone fixes for the Parent Portal report tools */
@media (max-width: 640px) {
  .report-tools, .report-tools .row-actions { width: 100%; }
  .report-tools .segmented { width: 100%; display: flex; }
  .report-tools .segmented button { flex: 1; padding: 0.5rem 0.4rem; font-size: 0.85rem; }
  .report-tools .row-actions .btn { flex: 1; }
  .dash-tabs button { padding: 0.65rem 0.7rem; font-size: 0.9rem; }
}
.mode-badge { display: inline-block; margin-top: 0.5rem; padding: 0.25rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 800; font-size: 0.85rem; opacity: 1 !important; }
.mode-pick { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; }
.mode-pick button { display: flex; flex-direction: column; gap: 0.2rem; text-align: left; border: 0; padding: 0.9rem; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); }
.mode-pick button[aria-checked="true"] { background: #F5F1FF; box-shadow: inset 0 0 0 3px var(--purple); }
.mode-pick small { color: var(--muted); line-height: 1.4; }
@media (max-width: 480px) { .mode-pick { grid-template-columns: 1fr; } }
.coverage { display: grid; gap: 0.7rem 1.2rem; margin-top: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cov { display: flex; gap: 0.6rem; align-items: center; }
.cov > span { font-size: 1.3rem; }
.cov > div { flex: 1; }
.cov .meta { display: flex; justify-content: space-between; font-size: 0.9rem; }
.cov .bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 0.3rem; }
.cov .bar span { display: block; height: 100%; border-radius: 999px; }
.folder-crew { top: 1.1rem; bottom: auto; }
.folder small { max-width: 100%; }
@media (max-width: 640px) {
  .exam-nav .q-dots { order: -1; flex-basis: 100%; margin-bottom: 0.4rem; }
}

/* New teaching pictures */
.vis-fractions { display: grid; gap: 0.6rem; }
.frac-row { display: flex; align-items: center; gap: 0.8rem; }
.frac-bar { flex: 1; display: grid; gap: 3px; height: 34px; padding: 3px; border-radius: 10px; background: var(--midnight); }
.frac-bar span { border-radius: 6px; background: #fff; }
.frac-bar span.on { background: var(--fc, var(--orange)); }
.frac-row strong { font-family: var(--display); font-size: 1.3rem; min-width: 3.2rem; text-align: right; }
.vis-pv { display: grid; gap: 4px; }
.pv-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.2rem; padding: 0.4rem 0.1rem; border-radius: 10px; background: #fff; min-width: 0; }
.pv-col small { font-size: 0.58rem; font-weight: 800; color: var(--muted); line-height: 1.15; text-align: center; word-break: break-word; }
.pv-col b { font-family: var(--display); font-size: 1.5rem; }
.pv-col.hl { background: var(--sunshine); }
.vis-bars { display: flex; align-items: flex-end; justify-content: center; gap: 0.8rem; min-height: 170px; padding-top: 0.5rem; }
.vb { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.vb-bar { width: 38px; border-radius: 8px 8px 0 0; transform-origin: bottom; }
.vb-v { font-weight: 800; font-size: 0.85rem; }
.vb small { font-weight: 800; font-size: 0.78rem; max-width: 70px; text-align: center; line-height: 1.2; }
