/* ============================================================
   EduManual.com — public stylesheet
   Child-friendly design system: rounded cards, big buttons,
   high contrast, gentle motion. Light + dark themes.
   ============================================================ */

:root {
  --ink: #2d2a3e;
  --ink-soft: #5b5672;
  --cream: #fff9f0;
  --paper: #ffffff;
  --tint: #f6f1ff;
  --line: #ece5f7;

  --primary: #7c5cfc;
  --primary-strong: #6339e8;
  --primary-soft: #ece4ff;
  --accent: #ffb703;
  --accent-strong: #e69a00;
  --accent-soft: #fff0c9;
  --teal: #06b6a4;
  --teal-soft: #d7f6f0;
  --coral: #ff6b6b;
  --coral-soft: #ffe3e3;
  --pink: #ec4899;
  --pink-soft: #ffe0ef;
  --green: #16a34a;
  --green-soft: #dcf7e6;
  --blue: #3b82f6;
  --blue-soft: #ddeaff;
  --dark: #241f3a;
  --dark-2: #2f2950;

  --num-0: #a855f7; --num-0-soft: #f3e8ff;
  --num-1: #f97316; --num-1-soft: #ffe8d4;
  --num-2: #0ea5e9; --num-2-soft: #d9f0fd;
  --num-3: #ec4899; --num-3-soft: #fde4f0;
  --num-4: #84cc16; --num-4-soft: #ecf8cf;
  --num-5: #ef4444; --num-5-soft: #fde2e2;
  --num-6: #14b8a6; --num-6-soft: #d3f5f0;
  --num-7: #eab308; --num-7-soft: #fdf3c9;
  --num-8: #6366f1; --num-8-soft: #e3e5fd;
  --num-9: #f43f5e; --num-9-soft: #ffe2e9;

  --radius: 1.25rem;
  --radius-sm: 0.8rem;
  --radius-lg: 1.75rem;
  --shadow: 0 6px 24px rgba(45, 42, 62, 0.08);
  --shadow-lg: 0 14px 44px rgba(45, 42, 62, 0.14);
  --font: 'Nunito', 'Segoe UI', 'Trebuchet MS', 'Comic Sans MS', system-ui, -apple-system, sans-serif;
  --header-h: 74px;
}

[data-theme="dark"] {
  --ink: #f2eefc;
  --ink-soft: #b7b0d0;
  --cream: #171428;
  --paper: #1f1b33;
  --tint: #221d3a;
  --line: #38305a;
  --primary: #9d83ff;
  --primary-soft: #342a5e;
  --accent-soft: #3d3118;
  --teal-soft: #123b35;
  --coral-soft: #421f24;
  --pink-soft: #421f33;
  --green-soft: #173a24;
  --blue-soft: #1c2b4a;
  --dark: #0f0c1e;
  --dark-2: #171226;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.55);
}

/* Accessibility: larger base font */
html[data-font="large"] { font-size: 19px; }
html[data-font="xlarge"] { font-size: 21px; }

/* Elements carrying the hidden attribute must ALWAYS stay hidden,
   even when another rule sets display (modals, buttons, chips…). */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-strong); }
[data-theme="dark"] a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5rem; font-weight: 800; }
p { margin: 0 0 0.75rem; }
ul { margin: 0; padding: 0; list-style: none; }
code { background: var(--tint); border: 1px solid var(--line); padding: 0.1rem 0.35rem; border-radius: 0.4rem; font-size: 0.9em; }
em { font-style: normal; color: var(--primary-strong); }
[data-theme="dark"] em { color: var(--primary); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary-soft); }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.shell-narrow { max-width: 860px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); font-size: 0.92rem; }
.inline-note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 0.6rem 1rem; font-size: 0.95rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--accent); color: #222; padding: 0.6rem 1rem; border-radius: 0 0 0.8rem 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------------- Top bar ---------------- */
.topbar { background: var(--dark); color: #fff; font-size: 0.85rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.topbar-note { margin: 0; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar-link { color: #fff; text-decoration: none; opacity: 0.9; font-weight: 600; white-space: nowrap; }
.topbar-link:hover { opacity: 1; }
.a11y-tools { display: flex; gap: 0.2rem; }
.icon-btn {
  background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 0.5rem;
  padding: 0.15rem 0.55rem; font-weight: 800; font-size: 0.85rem; cursor: pointer; font-family: inherit;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------------- Header ---------------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.brand-owl { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); padding: 4px; }
.brand-text { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text em { color: var(--primary-strong); }
.brand-text small { font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); margin-left: 2px; }
[data-theme="dark"] .brand-text em { color: var(--primary); }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 0.1rem; }
.nav-link {
  display: block; padding: 0.5rem 0.7rem; border-radius: 0.7rem; text-decoration: none;
  color: var(--ink-soft); font-weight: 700; font-size: 0.92rem; white-space: nowrap;
}
.nav-link:hover { background: var(--tint); color: var(--ink); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .nav-link.active { color: #d9ccff; }

.header-actions { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; }
.child-switch { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.child-switch-label { color: var(--ink-soft); font-weight: 700; }
.child-select { border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 0.7rem; padding: 0.3rem 0.5rem; font-family: inherit; font-weight: 700; max-width: 210px; }

.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 22px; height: 3px; background: var(--ink); border-radius: 3px; margin: 4px 0; transition: 0.2s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); position: absolute; width: 100%; z-index: 70; }
.mobile-menu ul { padding: 0.5rem 1.25rem 1.25rem; }
.mobile-menu li a { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.5rem; text-decoration: none; color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); }
.mobile-menu .mm-emoji { font-size: 1.3rem; }
.mobile-menu .mm-sep { height: 0.5rem; }
.mm-logout { padding: 0.75rem 0.5rem; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 0; border-radius: 999px; padding: 0.7rem 1.4rem;
  font-family: inherit; font-size: 1rem; font-weight: 800; cursor: pointer;
  text-decoration: none; line-height: 1.25; transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  min-height: 44px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .btn-secondary { color: #d9ccff; }
.btn-accent { background: var(--accent); color: #3a2c00; }
.btn-accent:hover { background: var(--accent-strong); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.65); }
.btn-outline:hover { border-color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 2px solid var(--line); }
.btn-ghost:hover { background: var(--tint); color: var(--ink); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--coral-soft); color: var(--coral); }
[data-theme="dark"] .btn-danger { color: #ff9d9d; }
.btn-green { background: var(--green-soft); color: var(--green); }
.btn-lg { font-size: 1.1rem; padding: 0.85rem 1.7rem; }
.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.9rem; min-height: 36px; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.8rem; min-height: 28px; border-radius: 0.6rem; }
.btn-block { width: 100%; }

/* ---------------- Chips / badges ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; border: 2px solid var(--line);
  border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.85rem; font-weight: 700;
  color: var(--ink-soft); text-decoration: none; background: var(--paper); cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary-strong); }
.chip-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-on:hover { color: #fff; }
.badge { display: inline-block; border-radius: 0.5rem; padding: 0.15rem 0.55rem; font-size: 0.78rem; font-weight: 800; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--accent-soft); color: #9a6b00; }
.badge-gray { background: var(--tint); color: var(--ink-soft); border: 1px solid var(--line); }

/* ---------------- Cards & grids ---------------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-body { padding: 1.3rem; }
.card-media { position: relative; display: block; aspect-ratio: 16/9; background: var(--tint); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft)); }
.card-tag { position: absolute; top: 0.7rem; left: 0.7rem; background: rgba(255, 255, 255, 0.92); color: var(--ink); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.78rem; font-weight: 800; }
.card-meta { color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; margin-bottom: 0.35rem; }
.card-title { font-size: 1.12rem; margin-bottom: 0.35rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--primary-strong); }
.card-text { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.9rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.subject-pill { background: var(--accent-soft); color: #7a5600; border-radius: 999px; padding: 0.15rem 0.65rem; font-size: 0.78rem; font-weight: 800; }
[data-theme="dark"] .subject-pill { color: #ffd75e; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-side { grid-template-columns: 1.4fr 1fr; }

/* ---------------- Sections & headings ---------------- */
.section { padding: 3.5rem 0; }
.section-tint { background: var(--tint); }
.section-dark { background: var(--dark); color: #fff; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.section-title { font-size: 1.7rem; display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.3rem; }
.section-icon { font-size: 1.9rem; }
.section-blurb { color: var(--ink-soft); margin: 0; max-width: 56ch; }
.section-link { font-weight: 800; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.page-hero { background: var(--paper); border-bottom: 1px solid var(--line); padding: 2.6rem 0 2.2rem; }
.page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-hero-tint { background: var(--tint); }
.page-hero-dark { background: var(--dark); color: #fff; border-bottom: 0; }
.page-hero-dark a { color: #d9ccff; }
.page-hero .hero-sub { font-size: 1.08rem; color: var(--ink-soft); max-width: 64ch; }
.page-hero-dark .hero-sub { color: #cfc7e8; }

.crumbs { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; }
.crumbs li { display: flex; gap: 0.35rem; }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--primary-strong); text-decoration: underline; }

/* ---------------- Hero (home) ---------------- */
.hero { background: linear-gradient(160deg, #f3edff 0%, #fff3f8 55%, #fff9ec 100%); border-bottom: 1px solid var(--line); padding: 3.4rem 0; }
[data-theme="dark"] .hero { background: linear-gradient(160deg, #241d45 0%, #2b1d3e 55%, #2d2418 100%); }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 2.5rem; align-items: center; }
.hero-eyebrow { display: inline-block; background: var(--primary-soft); color: var(--primary-strong); border-radius: 999px; padding: 0.35rem 1rem; font-weight: 800; font-size: 0.88rem; margin-bottom: 1rem; }
[data-theme="dark"] .hero-eyebrow { color: #d9ccff; }
.hero-title { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.02em; margin-bottom: 0.8rem; }
.hero-title em { color: var(--primary-strong); }
[data-theme="dark"] .hero-title em { color: var(--primary); }
.hero-sub { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 1.4rem; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.4rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; color: var(--ink-soft); font-weight: 700; font-size: 0.92rem; }
.hero-art { position: relative; }
.hero-art img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 6px solid #fff; }
.hero-float { position: absolute; font-size: 2.4rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.2)); animation: floaty 4s ease-in-out infinite; }
.float-1 { top: -18px; left: -12px; }
.float-2 { bottom: -14px; right: 8%; animation-delay: 1.2s; }
.float-3 { top: 12%; right: -16px; animation-delay: 0.6s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------------- Age cards ---------------- */
.age-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.age-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.9rem 1.5rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; display: flex; flex-direction: column; gap: 0.5rem;
}
.age-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.age-a:hover { border-color: var(--pink); }
.age-b:hover { border-color: var(--teal); }
.age-c:hover { border-color: var(--primary); }
.age-emoji { font-size: 2.7rem; }
.age-card h3 { font-size: 1.4rem; }
.age-card p { color: var(--ink-soft); margin: 0; }
.age-go { font-weight: 800; color: var(--primary-strong); }
.age-grid-big { grid-template-columns: repeat(3, 1fr); }
.age-points { margin: 0.4rem 0 1rem; }
.age-points li { padding: 0.22rem 0; font-weight: 600; color: var(--ink-soft); }
.center-note { text-align: center; color: var(--ink-soft); margin-top: 1.75rem; }
.age-switcher { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.age-switch { border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 0.45rem 1.1rem; font-weight: 800; text-decoration: none; }
.age-switch.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------- Subjects ---------------- */
.subject-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.subject-grid-big { grid-template-columns: repeat(3, 1fr); }
.subject-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s; display: block;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.subject-emoji { font-size: 2.3rem; display: block; margin-bottom: 0.4rem; }
.subject-card h3 { font-size: 1.15rem; }
.subject-card p { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }
.subject-count { display: inline-block; margin-top: 0.6rem; font-size: 0.8rem; font-weight: 800; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; padding: 0.15rem 0.7rem; }

/* ---------------- Inquiry-based learning steps ---------------- */
.inquiry-steps { display: grid; gap: 0.9rem; margin: 1.4rem 0; }
.inquiry-step {
  background: var(--paper); border: 2px solid var(--line); border-left: 6px solid var(--teal);
  border-radius: var(--radius-sm); padding: 0.9rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start;
  box-shadow: var(--shadow);
}
.inquiry-step-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; margin-top: 0.15rem;
}
.inquiry-step h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.inquiry-step p { margin: 0; color: var(--ink-soft); }
.experiment-box {
  background: var(--accent-soft); border: 2px dashed var(--accent-strong);
  border-radius: var(--radius-sm); padding: 1.1rem 1.4rem; margin: 1.4rem 0;
}
[data-theme="dark"] .experiment-box { border-color: var(--accent); }
.experiment-box h3 { margin-top: 0; font-size: 1.05rem; }
.experiment-box p { margin: 0; }

/* ---------------- Multisensory & phonics steps ---------------- */
.multi-steps { display: grid; gap: 0.9rem; margin: 1.4rem 0; }
.multi-step {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.9rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start; box-shadow: var(--shadow);
}
.multi-step h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.multi-step p { margin: 0; color: var(--ink-soft); }
.multi-icon { font-size: 1.7rem; flex-shrink: 0; margin-top: 0.1rem; }
.multi-see    { border-left: 6px solid var(--coral); }
.multi-hear   { border-left: 6px solid var(--blue); }
.multi-touch  { border-left: 6px solid var(--teal); }
.multi-say    { border-left: 6px solid var(--accent-strong); }
.multi-write  { border-left: 6px solid var(--primary); }
.multi-recall { border-left: 6px solid var(--green); }

.phonics-steps { display: grid; gap: 0.9rem; margin: 1.4rem 0; }
.phonics-step {
  background: var(--paper); border: 2px solid var(--line); border-left: 6px solid var(--pink);
  border-radius: var(--radius-sm); padding: 0.9rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start;
  box-shadow: var(--shadow);
}
.phonics-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--pink); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; margin-top: 0.15rem;
}
.phonics-step h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.phonics-step p { margin: 0; color: var(--ink-soft); }
.phonics-sound-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* Phonics blending widget */
.phonics-widget {
  background: linear-gradient(150deg, var(--pink-soft), var(--accent-soft));
  border: 2px solid var(--pink); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin: 1.4rem 0; text-align: center;
}
.phonics-tiles { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.phonic-tile {
  background: var(--paper); border: 3px solid var(--line); border-radius: 1rem;
  width: 96px; padding: 0.6rem 0.3rem; cursor: pointer; text-align: center;
  transition: transform 0.12s, border-color 0.12s; box-shadow: var(--shadow);
}
.phonic-tile:hover { transform: translateY(-3px); }
.phonic-tile.active { border-color: var(--accent-strong); transform: scale(1.06); background: var(--accent-soft); }
[data-theme="dark"] .phonic-tile.active { border-color: var(--accent); }
.phonic-letter { display: block; font-size: 1.9rem; font-weight: 800; color: var(--pink); }
.phonic-sound { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.phonic-emoji { display: block; font-size: 1.5rem; margin-top: 0.15rem; }
.phonics-controls { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.phonics-result { margin: 0.8rem 0 0; font-weight: 800; min-height: 1.5em; color: var(--pink); }
[data-theme="dark"] .phonics-result { color: #ff9cc8; }

/* ---------------- Microlearning plan ---------------- */
.micro-plan {
  background: linear-gradient(150deg, var(--blue-soft), var(--teal-soft));
  border: 2px solid var(--blue); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; margin: 1.2rem 0;
}
.micro-plan-head { margin: 0 0 0.6rem; font-weight: 700; }
.micro-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.micro-parts li {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 0.7rem;
  padding: 0.45rem 0.8rem;
}
.micro-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.micro-title { flex: 1; font-weight: 700; font-size: 0.95rem; }
.micro-time { flex-shrink: 0; font-size: 0.8rem; font-weight: 800; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 0.1rem 0.6rem; }

/* ---------------- Play hub ---------------- */
.play-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.play-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column;
}
.play-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.play-card-emoji { font-size: 2.4rem; }
.play-card h3 { font-size: 1.12rem; margin: 0.35rem 0 0.3rem; }
.play-card-desc { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.6rem; }
.play-card-objective {
  background: var(--teal-soft); border-radius: 0.6rem; padding: 0.5rem 0.7rem;
  font-size: 0.85rem; margin: 0 0 0.8rem; flex: 1;
}
.objective-banner {
  background: var(--accent-soft); border: 2px dashed var(--accent-strong);
  border-radius: var(--radius-sm); padding: 0.7rem 1.1rem; margin: 0.9rem 0; font-size: 0.98rem;
}
[data-theme="dark"] .objective-banner { border-color: var(--accent); }

/* ---------------- Scaffolding ladder & adaptive pace ---------------- */
.scaffold-ladder { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.scaffold-chip {
  flex: 1; min-width: 92px; background: var(--paper); border: 2px solid var(--line); border-radius: 0.9rem;
  padding: 0.5rem 0.4rem; font-family: inherit; font-weight: 800; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem; transition: transform 0.12s;
}
.scaffold-chip:hover { transform: translateY(-3px); border-color: var(--primary); }
.scaffold-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.scaffold-emoji { font-size: 1.2rem; }
.scaffold-chip small { font-size: 0.68rem; font-weight: 700; opacity: 0.85; }
.pace-badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 0.3rem 0.85rem;
  font-size: 0.85rem; font-weight: 800;
}
.pace-badge.normal { background: var(--blue-soft); color: var(--blue); }
.pace-badge.gentle { background: var(--green-soft); color: var(--green); }

/* ---------------- Guided practice (I Do / We Do / You Do) ---------------- */
.guided-widget { display: grid; gap: 0.9rem; margin: 1.2rem 0; }
.guided-step {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.3rem; box-shadow: var(--shadow);
}
.guided-ido   { border-left: 6px solid var(--blue); }
.guided-wedo  { border-left: 6px solid var(--accent-strong); }
.guided-youdo { border-left: 6px solid var(--green); }
.guided-step h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.guided-q { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.6rem; }
.guided-q input {
  width: 110px; text-align: center; font-size: 1.3rem; font-weight: 800;
  border: 3px dashed var(--line); border-radius: 0.7rem; padding: 0.3rem 0.5rem; font-family: inherit;
  background: var(--tint); color: var(--ink);
}
.guided-q input:focus { border-color: var(--primary); outline: none; }
.guided-blank { display: inline-block; min-width: 60px; text-align: center; }
.guided-blank.revealed { color: var(--blue); animation: fadeup 0.3s ease; }
.guided-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.guided-fb { margin: 0.7rem 0 0; font-weight: 800; min-height: 1.4em; }
.guided-fb.ok { color: var(--green); }
.guided-fb.try { color: var(--accent-strong); }
[data-theme="dark"] .guided-fb.try { color: var(--accent); }
.guided-fb.hint { color: var(--blue); }

/* ---------------- Problem-based learning ---------------- */
.pbl-scenario {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; font-size: 1.08rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.pbl-question {
  background: linear-gradient(140deg, var(--accent-soft), var(--primary-soft));
  border: 2px solid var(--accent-strong); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; margin: 1rem 0;
}
[data-theme="dark"] .pbl-question { border-color: var(--accent); }
.pbl-question-label { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; margin: 0 0 0.3rem; }
.pbl-question p:last-child { font-size: 1.2rem; font-weight: 800; margin: 0; }
.pbl-stage { text-align: center; }
.pbl-groups { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.pbl-group {
  background: var(--paper); border: 3px dashed var(--line); border-radius: 1rem;
  min-width: 150px; min-height: 120px; padding: 0.7rem;
}
.pbl-group-label { display: block; font-weight: 800; font-size: 0.85rem; margin-bottom: 0.4rem; }
.pbl-group-items { display: flex; flex-wrap: wrap; gap: 0.2rem; justify-content: center; }
.pbl-items { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.2rem; }
.pbl-item {
  background: var(--paper); border: 2px solid var(--line); border-radius: 0.8rem;
  font-size: 1.6rem; padding: 0.4rem 0.55rem; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.12s;
}
.pbl-item:hover { transform: translateY(-3px) scale(1.05); }
.pbl-reveal {
  background: linear-gradient(150deg, var(--teal-soft), var(--green-soft));
  border: 2px solid var(--teal); border-radius: var(--radius);
  padding: 1.5rem 1.8rem; margin-top: 1.6rem; text-align: center;
}
.pbl-concept { font-size: 1.15rem; font-weight: 800; margin: 0.3rem 0 0.6rem; }
.pbl-explanation { background: var(--paper); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }

/* ---------------- Method effectiveness bars (admin) ---------------- */
.method-bars { display: grid; gap: 0.7rem; margin: 1.2rem 0; }
.method-bar-row { display: flex; align-items: center; gap: 0.9rem; }
.method-bar-label { flex: 0 0 200px; font-weight: 800; font-size: 0.92rem; }
.method-bar-track { flex: 1; height: 22px; background: var(--tint); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.method-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--primary)); border-radius: 999px; transition: width 0.4s ease; }
.method-bar-value { flex: 0 0 56px; font-weight: 800; color: var(--primary-strong); }
[data-theme="dark"] .method-bar-value { color: var(--primary); }
.method-bar-n { flex: 0 0 130px; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------------- Mandarin learning system ---------------- */
.tone-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; }
.tone-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 0.9rem; text-align: center; box-shadow: var(--shadow);
}
.tone-mark { font-size: 2.4rem; font-weight: 800; display: block; line-height: 1.1; }
.tone-shape { font-size: 1.1rem; color: var(--ink-soft); font-weight: 800; letter-spacing: 0.1em; }
.tone-card h3 { margin: 0.4rem 0 0.2rem; font-size: 1rem; }
.tone-card p { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.tone-high   { border-color: var(--blue); } .tone-high .tone-mark { color: var(--blue); }
.tone-rising { border-color: var(--teal); } .tone-rising .tone-mark { color: var(--teal); }
.tone-dip    { border-color: var(--accent-strong); } .tone-dip .tone-mark { color: var(--accent-strong); }
.tone-falling{ border-color: var(--coral); } .tone-falling .tone-mark { color: var(--coral); }
.tone-neutral{ border-color: var(--line); } .tone-neutral .tone-mark { color: var(--ink-soft); }
[data-theme="dark"] .tone-dip .tone-mark { color: var(--accent); }

.pinyin-info { margin-top: 1.2rem; max-width: 560px; }

.builder-board { max-width: 760px; margin: 0 auto; }
.builder-slots { display: flex; align-items: flex-end; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.builder-slot { text-align: center; }
.builder-label { display: block; font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 0.3rem; }
.builder-select { width: 140px; }
.builder-plus { font-size: 1.6rem; font-weight: 800; color: var(--ink-soft); padding-bottom: 0.9rem; }
.tone-picker { display: flex; gap: 0.4rem; }
.tone-pick {
  width: 52px; height: 52px; border: 2px solid var(--line); border-radius: 0.8rem; background: var(--paper);
  font-size: 1.5rem; font-weight: 800; cursor: pointer; font-family: inherit; color: var(--ink);
}
.tone-pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.builder-result { margin-top: 1.6rem; background: var(--tint); border-radius: var(--radius); padding: 1.4rem; }
.builder-syllable { font-size: 1.6rem; font-weight: 800; margin: 0 0 0.4rem; }
.builder-meaning { font-size: 1.1rem; margin: 0 0 0.8rem; }
.builder-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

.syllable-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8rem; }
.syllable-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.9rem 0.5rem; text-align: center; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.13s; display: flex; flex-direction: column; gap: 0.1rem;
}
.syllable-card:hover { transform: translateY(-4px); }
.tone-1-border { border-color: var(--blue-soft); }
.tone-2-border { border-color: var(--teal-soft); }
.tone-3-border { border-color: var(--accent-soft); }
.tone-4-border { border-color: var(--coral-soft); }
.tone-0-border { border-color: var(--line); }
.syllable-pinyin { font-size: 1.4rem; font-weight: 800; }
.syllable-char { font-size: 1.6rem; font-weight: 800; }
.syllable-emoji { font-size: 1.4rem; }
.syllable-meaning { font-size: 0.78rem; color: var(--ink-soft); }

.syllable-hero { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: center; }
.syllable-hero-card { border-radius: var(--radius-lg); padding: 1.6rem; text-align: center; border: 3px solid var(--line); }
.tone-1-bg { background: var(--blue-soft); } .tone-2-bg { background: var(--teal-soft); }
.tone-3-bg { background: var(--accent-soft); } .tone-4-bg { background: var(--coral-soft); }
.tone-0-bg { background: var(--tint); }
.syllable-big-pinyin { display: block; font-size: 2.6rem; font-weight: 800; }
.syllable-big-char { display: block; font-size: 3rem; font-weight: 800; line-height: 1.15; }
.syllable-big-emoji { display: block; font-size: 2.2rem; }

.word-grid-wide { grid-template-columns: repeat(5, 1fr); }
.mandarin-word-card { position: relative; }
.mandarin-hanzi { font-size: 1.5rem; font-weight: 800; }
.mandarin-pinyin { color: var(--primary-strong); font-weight: 700; font-size: 0.95rem; }
[data-theme="dark"] .mandarin-pinyin { color: var(--primary); }
.sg-badge { position: absolute; top: 0.4rem; right: 0.5rem; font-size: 0.75rem; font-weight: 800; background: var(--coral-soft); color: var(--coral); border-radius: 0.4rem; padding: 0.05rem 0.4rem; }
.mandarin-hanzi-hero { font-size: 3.4rem; }
.writing-card { max-width: 520px; margin: 0 auto; }
.sent-slot { cursor: pointer; }
.sent-card { min-height: 64px; }

/* ---------------- Science learning engine ---------------- */
.concept-list { display: grid; gap: 0.9rem; margin-top: 1.2rem; }
.concept-card { border-left: 6px solid var(--teal); }
.concept-card .card-title { font-size: 1.15rem; }

.glossary-cards { display: grid; gap: 0.9rem; }
.glossary-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.3rem; box-shadow: var(--shadow);
}
.glossary-card-full .glossary-term { font-size: 1.1rem; }
.glossary-term { margin: 0 0 0.3rem; }

.misconception-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow);
}
.misconception-big { border-left: 6px solid var(--coral); }
.misconception-bad { font-weight: 800; color: var(--coral); margin-bottom: 0.4rem; }
.misconception-good { font-weight: 800; color: var(--green); margin-bottom: 0.4rem; }

.data-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.data-table-wrap input { min-width: 80px; }
.chart-box { margin: 1.2rem 0; }
.chart-canvas { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.2rem; min-height: 160px; }
.chart-bars { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 150px; }
.chart-bar {
  flex: 1; max-width: 46px; background: linear-gradient(180deg, var(--teal), var(--primary));
  border-radius: 0.4rem 0.4rem 0 0; position: relative; transition: height 0.4s ease;
}
.chart-bar-value { position: absolute; top: -1.3rem; left: 0; right: 0; text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--ink-soft); }

.sim-controls { display: grid; gap: 1.1rem; margin-bottom: 1.2rem; }
.sim-control { display: flex; align-items: center; gap: 1rem; }
.sim-control .label { margin: 0; flex: 0 0 180px; }
.sim-slider { flex: 1; accent-color: var(--primary); }
.sim-value { flex: 0 0 40px; font-weight: 800; text-align: center; }
.sim-plant { text-align: center; font-size: 3.4rem; margin: 0.8rem 0; transition: all 0.3s; }

.science-map-flow { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.science-map-node {
  display: flex; align-items: center; gap: 0.6rem; background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 0.6rem 1.4rem; cursor: pointer; font-family: inherit; font-size: 1rem;
  font-weight: 800; color: var(--ink); box-shadow: var(--shadow); transition: transform 0.12s;
}
.science-map-node:hover { transform: translateY(-3px); border-color: var(--teal); }
.science-map-arrow { font-size: 1.3rem; color: var(--teal); font-weight: 800; }

/* ---------------- Mind map strip & demo ---------------- */
.mindmap-strip { background: linear-gradient(140deg, var(--dark) 0%, var(--dark-2) 100%); color: #fff; }
.mindmap-strip-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.mindmap-strip h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.mindmap-strip h2 em { color: var(--accent); }
.mindmap-strip-copy p { color: #cfc7e8; }
.mindmap-demo { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.mm-chip {
  background: rgba(255, 255, 255, 0.07); border: 2px solid var(--chip-color, #fff);
  border-radius: 1rem; padding: 0.7rem 0.6rem; width: 96px; text-align: center; color: #fff;
}
.mm-chip img { width: 52px; height: 52px; margin: 0 auto 0.25rem; border-radius: 0.7rem; background: #fff; }
.mm-chip-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--chip-color, #fff); }
.mm-chip-name { font-size: 0.78rem; font-weight: 700; }

/* ---------------- Numbers ---------------- */
.number-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.number-grid-small { grid-template-columns: repeat(5, 1fr); }
.number-card {
  position: relative; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 0.7rem; text-decoration: none; color: var(--ink); text-align: center;
  box-shadow: var(--shadow); transition: transform 0.15s; display: block;
}
.number-card:hover { transform: translateY(-5px) rotate(-1.5deg); }
.number-value { font-size: 2.4rem; font-weight: 800; display: block; line-height: 1.1; }
.number-card img { width: 74px; height: 74px; object-fit: cover; border-radius: 0.9rem; margin: 0.4rem auto; }
.number-name { display: block; font-weight: 800; }
.number-emoji { position: absolute; top: 0.4rem; right: 0.5rem; font-size: 1.2rem; }
.num-bg-0 { --nc: var(--num-0); }
.num-bg-1 { --nc: var(--num-1); }
.num-bg-2 { --nc: var(--num-2); }
.num-bg-3 { --nc: var(--num-3); }
.num-bg-4 { --nc: var(--num-4); }
.num-bg-5 { --nc: var(--num-5); }
.num-bg-6 { --nc: var(--num-6); }
.num-bg-7 { --nc: var(--num-7); }
.num-bg-8 { --nc: var(--num-8); }
.num-bg-9 { --nc: var(--num-9); }
.number-card.num-bg-0 { border-color: var(--num-0-soft); } .number-card.num-bg-0 .number-value { color: var(--num-0); }
.number-card.num-bg-1 { border-color: var(--num-1-soft); } .number-card.num-bg-1 .number-value { color: var(--num-1); }
.number-card.num-bg-2 { border-color: var(--num-2-soft); } .number-card.num-bg-2 .number-value { color: var(--num-2); }
.number-card.num-bg-3 { border-color: var(--num-3-soft); } .number-card.num-bg-3 .number-value { color: var(--num-3); }
.number-card.num-bg-4 { border-color: var(--num-4-soft); } .number-card.num-bg-4 .number-value { color: var(--num-4); }
.number-card.num-bg-5 { border-color: var(--num-5-soft); } .number-card.num-bg-5 .number-value { color: var(--num-5); }
.number-card.num-bg-6 { border-color: var(--num-6-soft); } .number-card.num-bg-6 .number-value { color: var(--num-6); }
.number-card.num-bg-7 { border-color: var(--num-7-soft); } .number-card.num-bg-7 .number-value { color: var(--num-7); }
.number-card.num-bg-8 { border-color: var(--num-8-soft); } .number-card.num-bg-8 .number-value { color: var(--num-8); }
.number-card.num-bg-9 { border-color: var(--num-9-soft); } .number-card.num-bg-9 .number-value { color: var(--num-9); }

.cta-band {
  margin-top: 2rem; background: linear-gradient(120deg, var(--primary), var(--pink));
  color: #fff; border-radius: var(--radius-lg); padding: 1.6rem 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.cta-band h3 { margin: 0; }
.cta-band p { margin: 0; opacity: 0.92; }

.number-hero { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: center; }
.number-hero-art { border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; border: 3px solid var(--line); }
.number-hero-art img { width: 150px; height: 150px; object-fit: cover; border-radius: 1.2rem; margin: 0.5rem auto; }
.number-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------------- Memory story boxes ---------------- */
.mm-chain { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.mm-link { display: flex; align-items: center; gap: 0.4rem; }
.mm-link-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: 1rem; padding: 0.8rem 0.5rem;
  width: 108px; text-align: center; box-shadow: var(--shadow);
}
.mm-link-card img { width: 56px; height: 56px; object-fit: cover; border-radius: 0.7rem; margin: 0.2rem auto; }
.mm-arrow { font-size: 1.4rem; color: var(--ink-soft); font-weight: 800; }

.story-box {
  background: var(--paper); border: 2px dashed var(--primary); border-radius: var(--radius-lg);
  padding: 1.8rem 2rem; margin: 1.25rem 0;
}
.story-box p { font-size: 1.1rem; margin-bottom: 0.7rem; }
.story-title { font-size: 1.3rem; }

/* ---------------- Mind map tool ---------------- */
.mm-controls { max-width: 720px; margin: 0 auto; }
.mm-input-row { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.mm-input { flex: 1; min-width: 200px; }
.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; margin-top: 1rem; }
.keypad-key {
  background: var(--paper); border: 2px solid var(--line); border-radius: 0.9rem; padding: 0.55rem 0.2rem;
  font-family: inherit; font-size: 1.25rem; font-weight: 800; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-height: 56px;
}
.keypad-key small { font-size: 0.62rem; font-weight: 700; color: var(--ink-soft); }
.keypad-key:hover { border-color: var(--primary); }
.keypad-action { background: var(--tint); font-size: 1rem; justify-content: center; }
.mm-levels { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.1rem; flex-wrap: wrap; }

.mm-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.mm-tab {
  background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 0.55rem 1.2rem;
  font-family: inherit; font-weight: 800; font-size: 1rem; color: var(--ink-soft); cursor: pointer;
}
.mm-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mm-pane { animation: fadeup 0.3s ease; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mm-seq-display { text-align: center; font-size: 1.25rem; }
.mm-seq-display strong { font-size: 1.6rem; letter-spacing: 0.12em; color: var(--primary-strong); }
[data-theme="dark"] .mm-seq-display strong { color: var(--primary); }
.mm-pane .mm-chain { margin: 1.25rem 0; }
.mm-map-node { position: relative; cursor: pointer; }

.recall-modes { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.4rem; }
.recall-stage { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.recall-slots { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.recall-slot {
  width: 72px; height: 86px; border-radius: 1rem; border: 3px dashed var(--line); background: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: var(--primary-strong);
}
.recall-slot.filled { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.recall-slot.blank { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.recall-tiles { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.recall-tile {
  width: 96px; padding: 0.6rem; border-radius: 1rem; border: 2px solid var(--line); background: var(--paper);
  cursor: pointer; text-align: center; box-shadow: var(--shadow); transition: transform 0.12s;
}
.recall-tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.recall-tile img { width: 52px; height: 52px; object-fit: cover; border-radius: 0.6rem; margin: 0 auto 0.2rem; }
.recall-tile .tile-digit { font-weight: 800; font-size: 1.1rem; display: block; }
.recall-tile.used { opacity: 0.35; pointer-events: none; }
.recall-input-row { display: flex; gap: 0.6rem; }
.recall-input-row .input { width: 180px; text-align: center; font-size: 1.5rem; letter-spacing: 0.2em; }
.recall-stars { font-size: 2.2rem; margin: 0; }
.recall-msg { font-size: 1.05rem; font-weight: 700; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 15, 40, 0.55); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.modal { background: var(--paper); border-radius: var(--radius-lg); padding: 2rem; max-width: 460px; width: 100%; position: relative; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 0.9rem; right: 0.9rem; background: var(--tint); border: 0; border-radius: 50%; width: 38px; height: 38px; font-weight: 800; cursor: pointer; }
.mm-modal-art { font-size: 4rem; text-align: center; }
.mm-modal-art img { width: 130px; height: 130px; object-fit: cover; border-radius: 1.2rem; margin: 0 auto; }
.modal-actions { display: flex; gap: 0.7rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* ---------------- Words ---------------- */
.word-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.9rem; }
.word-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.9rem 0.4rem; text-decoration: none; color: var(--ink); text-align: center; box-shadow: var(--shadow);
  transition: transform 0.13s; display: flex; flex-direction: column; gap: 0.2rem;
}
.word-card:hover { transform: translateY(-4px); border-color: var(--teal); }
.word-emoji { font-size: 2rem; }
.word-name { font-weight: 800; font-size: 1.05rem; }
.word-letters { font-size: 0.72rem; letter-spacing: 0.18em; color: var(--ink-soft); font-weight: 700; }
.word-cloud { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.word-cloud-item {
  display: inline-flex; align-items: center; gap: 0.5rem; background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 0.45rem 1.1rem; text-decoration: none; color: var(--ink); font-weight: 800; box-shadow: var(--shadow);
}
.word-cloud-item:hover { border-color: var(--teal); }
.word-hero { display: grid; grid-template-columns: 200px 1fr; gap: 1.75rem; align-items: center; }
.word-hero-art { text-align: center; }
.word-hero-art img { width: 130px; margin: 0.4rem auto; border-radius: 1rem; }
.word-big-emoji { font-size: 4.5rem; display: block; }
.word-letters-lg { font-size: 1.6rem; letter-spacing: 0.3em; margin: 0.2rem 0 0.8rem; }
.word-name-lg { font-size: 1.5rem; }

.studio-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.studio-pane { animation: fadeup 0.3s ease; }
.flashcard {
  max-width: 420px; margin: 0 auto 1rem; text-align: center; padding: 2rem 1.5rem; cursor: pointer;
}
.activity-stage { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.8rem; }
.letter-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; min-height: 64px; margin-bottom: 1.2rem; }
.letter-slot {
  width: 58px; height: 64px; border-radius: 0.9rem; border: 3px dashed var(--line); background: var(--tint);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: var(--ink);
}
.letter-slot.filled { border-style: solid; border-color: var(--teal); background: var(--teal-soft); }
.letter-slot.blank { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.option-row { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.letter-option {
  width: 64px; height: 64px; border-radius: 1rem; border: 2px solid var(--line); background: var(--paper);
  font-size: 1.5rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); font-family: inherit; color: var(--ink);
  transition: transform 0.12s;
}
.letter-option:hover { transform: translateY(-3px); border-color: var(--primary); }
.letter-option:disabled { opacity: 0.3; cursor: default; transform: none; }
.activity-feedback { text-align: center; font-weight: 800; min-height: 1.6em; margin: 1rem 0 0; }
.activity-feedback.ok { color: var(--green); }
.activity-feedback.try { color: var(--accent-strong); }
[data-theme="dark"] .activity-feedback.try { color: var(--accent); }
.match-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; max-width: 520px; margin: 0 auto 1rem; }
.match-option { padding: 0.9rem 0.5rem; text-align: center; border-radius: 1rem; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font-size: 1.8rem; box-shadow: var(--shadow); }
.match-option:hover { border-color: var(--teal); }
.match-option .match-label { display: block; font-size: 1rem; font-weight: 800; }
.word-done { text-align: center; padding: 2rem 0; }
.spell-hint { text-align: center; }

/* ---------------- Math practice ---------------- */
.topic-strip { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.topic-strip-inline { margin-top: 1rem; }
.topic-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 0.5rem 1.1rem; text-decoration: none; color: var(--ink); font-weight: 800; box-shadow: var(--shadow);
}
.topic-chip:hover { border-color: var(--primary); }
.topic-chip-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.math-stage { max-width: 640px; margin: 0 auto; }
.math-stats { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.math-question { font-size: 1.7rem; font-weight: 800; text-align: center; margin: 0.4rem 0 1rem; }
.math-visual { display: flex; justify-content: center; gap: 0.15rem; flex-wrap: wrap; margin-bottom: 1.3rem; min-height: 60px; }
.math-visual .mobj { font-size: 1.9rem; }
.math-visual .mobj.fade { opacity: 0.22; filter: grayscale(1); }
.math-visual .mgroup { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin: 0 0.6rem; }
.math-visual .mrow { display: flex; gap: 0.15rem; }
.math-visual .mop { font-size: 2rem; font-weight: 800; align-self: center; color: var(--ink-soft); }
.math-visual .mfraction { font-size: 1.8rem; font-weight: 800; text-align: center; line-height: 1.15; }
.math-visual .mfraction .frac-bottom { border-top: 3px solid var(--ink); display: block; }
.math-visual .mgroups { display: flex; gap: 1rem; }
.math-visual .mgroups .mgroup { border: 2px dashed var(--line); border-radius: 1rem; padding: 0.5rem; }
.math-answer-row { display: flex; gap: 0.7rem; justify-content: center; }
.math-input { max-width: 220px; text-align: center; font-size: 1.4rem; }
.math-explanation { background: var(--teal-soft); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-top: 1rem; font-weight: 600; }
.math-keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-top: 1.1rem; max-width: 400px; margin-left: auto; margin-right: auto; }
.math-roundup { text-align: center; margin-top: 2rem; }

/* ---------------- Quiz player ---------------- */
.quiz-shell { max-width: 680px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; margin-bottom: 0.7rem; }
.quiz-progress-bar { height: 10px; background: var(--tint); border-radius: 999px; overflow: hidden; margin-bottom: 1.4rem; }
.quiz-progress-bar div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--pink)); border-radius: 999px; transition: width 0.3s; }
.quiz-question { font-size: 1.35rem; font-weight: 800; margin-bottom: 1.2rem; }
.quiz-question img { border-radius: 1rem; margin: 0.7rem auto; max-height: 220px; }
.quiz-options { display: grid; gap: 0.7rem; }
.quiz-options.grid-2 { grid-template-columns: 1fr 1fr; }
.quiz-option {
  display: flex; align-items: center; gap: 0.7rem; background: var(--tint); border: 3px solid var(--line);
  border-radius: 1rem; padding: 0.85rem 1rem; cursor: pointer; font-weight: 700; font-family: inherit; font-size: 1rem; color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}
.quiz-option:hover { border-color: var(--primary); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.quiz-option .qopt-emoji { font-size: 1.6rem; }
.quiz-option img { width: 54px; height: 54px; object-fit: cover; border-radius: 0.6rem; }
.quiz-nav { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
.quiz-spacer { flex: 1; }
.quiz-fill-input { font-size: 1.2rem; }
.quiz-order-list { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.quiz-order-chip { border: 2px solid var(--line); background: var(--paper); border-radius: 0.8rem; padding: 0.5rem 1rem; font-weight: 800; cursor: pointer; font-family: inherit; font-size: 1rem; color: var(--ink); }
.quiz-order-chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

.score-ring {
  --score: 50; --ring-color: var(--green);
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 1.2rem;
  background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), var(--tint) 0);
  display: flex; align-items: center; justify-content: center;
}
.score-ring span { background: var(--paper); width: 118px; height: 118px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; }
.ring-good { --ring-color: var(--green); }
.ring-ok { --ring-color: var(--accent); }

.review-list { display: grid; gap: 0.9rem; }
.review-item { display: flex; gap: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }
.review-status { font-size: 1.3rem; }
.review-question { font-weight: 700; margin: 0 0 0.3rem; }
.review-explanation { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* ---------------- Videos ---------------- */
.video-frame { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; color: #fff; font-size: 3rem; }
.play-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.4rem; background: rgba(0,0,0,0.35); border-radius: 50%; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; }
.duration-badge { position: absolute; bottom: 0.7rem; right: 0.7rem; background: rgba(0,0,0,0.7); color: #fff; border-radius: 0.5rem; padding: 0.1rem 0.5rem; font-size: 0.78rem; font-weight: 700; }
.transcript-box { margin-top: 1.4rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.transcript-box summary { padding: 0.9rem 1.2rem; font-weight: 800; cursor: pointer; }
.transcript-body { padding: 0 1.2rem 1.2rem; color: var(--ink-soft); font-size: 0.95rem; }
.video-embed-card { background: var(--blue-soft); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; margin: 1.2rem 0; }

/* ---------------- Games ---------------- */
.game-emoji { font-size: 3rem; margin: 0 0 0.5rem; }
.game-stage { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; }
.game-options { display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; }
.game-big-option {
  min-width: 110px; padding: 1rem 0.8rem; border-radius: 1.2rem; border: 3px solid var(--line); background: var(--paper);
  font-size: 2.4rem; cursor: pointer; box-shadow: var(--shadow); text-align: center; transition: transform 0.12s;
}
.game-big-option:hover { transform: translateY(-4px) scale(1.04); border-color: var(--primary); }
.game-big-option .game-opt-label { display: block; font-size: 0.95rem; font-weight: 800; }
.game-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.game-card-tile {
  width: 96px; height: 110px; border-radius: 1rem; border: 3px solid var(--line); background: var(--paper);
  font-size: 2.2rem; cursor: pointer; box-shadow: var(--shadow); font-family: inherit;
  transition: transform 0.2s, border-color 0.2s;
}
.game-card-tile:hover { transform: translateY(-3px); }
.game-card-tile.flipped { border-color: var(--teal); background: var(--teal-soft); }
.game-card-tile.matched { border-color: var(--green); background: var(--green-soft); opacity: 0.75; }
.game-card-tile.hidden-tile { color: transparent; background: linear-gradient(135deg, var(--primary-soft), var(--pink-soft)); }
.game-roundup { text-align: center; margin-top: 2rem; }

/* ---------------- Daily ---------------- */
.daily-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; }
.daily-chip {
  background: var(--paper); border: 2px solid var(--line); border-radius: 1rem; padding: 1rem 0.8rem;
  text-decoration: none; color: var(--ink); text-align: center; box-shadow: var(--shadow); transition: transform 0.13s;
}
.daily-chip:hover { transform: translateY(-4px); border-color: var(--accent); }
.daily-icon { font-size: 2rem; display: block; margin-bottom: 0.4rem; }
.daily-title { font-weight: 700; font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.daily-list { display: grid; gap: 0.9rem; max-width: 820px; margin: 0 auto; }
.daily-row {
  display: flex; align-items: center; gap: 1rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.3rem; box-shadow: var(--shadow);
}
.daily-row.done { opacity: 0.72; }
.daily-check {
  background: var(--tint); border: 2px solid var(--line); border-radius: 50%; width: 44px; height: 44px;
  font-size: 1.2rem; cursor: pointer; flex-shrink: 0; color: var(--green);
}
.daily-check:disabled { cursor: not-allowed; opacity: 0.5; }
.daily-row-main { flex: 1; }
.daily-row-main h3 { font-size: 1.05rem; margin: 0 0 0.15rem; }
.daily-row-main p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.daily-progress-note { text-align: center; margin-top: 1.5rem; font-weight: 700; }

/* ---------------- Search ---------------- */
.search-form { display: flex; gap: 0.7rem; max-width: 640px; }
.search-input { flex: 1; }
.search-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; }
.results-count { color: var(--ink-soft); font-weight: 700; margin-bottom: 1.2rem; }
.search-results { display: grid; gap: 0.8rem; }
.search-result { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); }
.search-kind { display: inline-block; background: var(--primary-soft); color: var(--primary-strong); border-radius: 0.5rem; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 800; margin-bottom: 0.4rem; }
.search-result h3 { margin: 0 0 0.25rem; }
.search-result p { margin: 0; color: var(--ink-soft); }
.popular-searches { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 1rem; }

/* ---------------- Articles ---------------- */
.article-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start; }
.article-hero-img { border-radius: var(--radius-lg); margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.article-meta { color: var(--ink-soft); font-size: 0.9rem; font-weight: 700; }
.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.prose { font-size: 1.05rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6rem; }
.prose ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.6rem 0.8rem; text-align: left; }
.prose th { background: var(--tint); }
.prose img { border-radius: 1rem; margin: 1rem 0; }
.prose blockquote { border-left: 4px solid var(--accent); background: var(--accent-soft); margin: 1.2rem 0; padding: 0.9rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.objectives-box { background: var(--green-soft); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 0 0 1.5rem; }
.objectives-box h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.objectives-box ul { margin: 0; }
.check-list { list-style: none; }
.check-list li { padding: 0.28rem 0; }
.check-list li::before { content: '✅ '; }
.lesson-intro { background: var(--blue-soft); border-radius: var(--radius-sm); padding: 1.1rem 1.4rem; margin-bottom: 1.4rem; font-size: 1.05rem; }
.lesson-desc { color: var(--ink-soft); max-width: 60ch; }
.sequence-embed, .math-embed { background: var(--primary-soft); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.seq-embed-label { margin: 0 0 0.6rem; }

.article-side { display: grid; gap: 1.2rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.side-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.side-box h3 { font-size: 1.05rem; }
.side-box-accent { background: linear-gradient(140deg, var(--accent-soft), var(--primary-soft)); border: 0; }
.side-link { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.side-link:last-child { border-bottom: 0; }
.side-link strong { display: block; }
.side-link span { color: var(--ink-soft); font-size: 0.82rem; }

.comments-block { margin-top: 2.5rem; }
.comment { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin-bottom: 0.8rem; }
.comment-head { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.comment-form { background: var(--tint); border-radius: var(--radius-sm); padding: 1.2rem; margin-top: 1rem; }

/* ---------------- Progress dashboard ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; }
.stat-grid-wide { grid-template-columns: repeat(6, 1fr); }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary-strong); }
[data-theme="dark"] .stat-value { color: var(--primary); }
.stat-label { color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.child-cards { display: grid; gap: 0.8rem; margin-bottom: 1.4rem; }
.child-card {
  display: flex; align-items: center; gap: 1rem; background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow);
}
.child-card.child-active { border-color: var(--primary); background: var(--primary-soft); }
.child-avatar { font-size: 2rem; }
.child-info { flex: 1; }
.child-info h3 { margin: 0; font-size: 1.05rem; }
.child-info p { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.child-switcher { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.add-child-box { margin-top: 1rem; }
.add-child-summary { font-weight: 800; padding: 1rem 1.3rem; cursor: pointer; }
.activity-list { display: grid; gap: 0.6rem; }
.activity-item { display: flex; gap: 0.9rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.8rem 1rem; }
.activity-icon { font-size: 1.5rem; }
.activity-title { font-weight: 700; margin: 0; }
.achievement-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; }
.achievement-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 0.8rem; text-align: center; }
.achievement-card.locked { opacity: 0.55; filter: grayscale(0.7); }
.achievement-icon { font-size: 2.2rem; display: block; margin-bottom: 0.3rem; }
.achievement-card h3 { font-size: 0.98rem; margin-bottom: 0.2rem; }
.achievement-card p { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }
.achievement-date { display: block; margin-top: 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--green); }
.achievement-line { margin: 0 0 0.4rem; font-weight: 700; }
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.rec-grid-col { grid-template-columns: 1fr; }
.rec-card {
  display: flex; align-items: center; gap: 0.9rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.13s;
}
.rec-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.rec-emoji { font-size: 1.8rem; }
.rec-card h3 { font-size: 1rem; margin: 0; }
.rec-card p { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.rec-go { margin-left: auto; font-weight: 800; color: var(--primary-strong); }

.bar { height: 12px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--primary)); border-radius: 999px; }

.report-sheet { background: #fff; color: #222; border: 1px solid #ddd; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
[data-theme="dark"] .report-sheet { background: #fff; color: #222; }
.report-head h2 { margin-bottom: 0.2rem; }
.report-table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.report-table th, .report-table td { border: 1px solid #ddd; padding: 0.55rem 0.8rem; text-align: left; }
.report-table th { background: #f3edff; }
.report-list { list-style: disc; padding-left: 1.3rem; margin-bottom: 1rem; }
.report-list li { margin-bottom: 0.25rem; }
.report-foot { border-top: 2px solid #eee; margin-top: 1.6rem; padding-top: 1rem; font-size: 0.85rem; color: #666; }

/* ---------------- Parents CTA / footer ---------------- */
.section-parents { background: linear-gradient(130deg, var(--teal-soft), var(--blue-soft)); }
.parents-inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 2.5rem; align-items: center; }
.parents-card { background: var(--paper); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-lg); }
.parents-card-title { font-weight: 800; font-size: 1.1rem; }
.parents-card-note { text-align: center; color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.8rem; }
.parents-card .btn-block { margin-bottom: 0.6rem; }

.footer-cta { background: var(--dark); color: #fff; padding: 2.6rem 0; }
.footer-cta-inner { display: flex; align-items: center; gap: 1.6rem; }
.footer-cta-inner > div { flex: 1; }
.footer-cta h2 { margin-bottom: 0.2rem; }
.footer-cta p { color: #cfc7e8; margin: 0; }
.footer-cta-btns { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: flex-end; }
.footer-owl { width: 76px; height: 76px; }

.site-footer { background: #171226; color: #b9b2d4; padding: 3rem 0 1.4rem; }
[data-theme="dark"] .site-footer { background: #0f0c1e; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand-name { color: #fff; }
.footer-brand p { font-size: 0.9rem; }
.footer-tagline { color: var(--accent); font-weight: 800; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 0.7rem; }
.site-footer ul li { margin-bottom: 0.4rem; }
.site-footer ul a { color: #b9b2d4; text-decoration: none; font-size: 0.9rem; }
.site-footer ul a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.2rem; font-size: 0.85rem; }
.footer-bottom p { margin: 0; }
.footer-demo { color: #8f86b4; }

/* ---------------- Mobile bottom nav ---------------- */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  background: var(--paper); border-top: 1px solid var(--line); padding: 0.4rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
}
.mobile-bottom-nav a, .mobile-bottom-nav button {
  background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  color: var(--ink-soft); text-decoration: none; font-family: inherit; font-size: 1.3rem; cursor: pointer; padding: 0.2rem 0;
}
.mobile-bottom-nav em { font-style: normal; font-size: 0.7rem; font-weight: 800; }
.mobile-bottom-nav a.active { color: var(--primary-strong); }
[data-theme="dark"] .mobile-bottom-nav a.active { color: var(--primary); }

/* ---------------- Forms ---------------- */
.input {
  width: 100%; border: 2px solid var(--line); border-radius: 0.8rem; padding: 0.65rem 0.9rem;
  font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); min-height: 46px;
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.input-lg { font-size: 1.15rem; min-height: 54px; }
.input-sm { min-height: 34px; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
textarea.input { resize: vertical; }
.label { display: block; font-weight: 800; margin-bottom: 0.35rem; font-size: 0.95rem; }
.form-field { margin-bottom: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 1.3rem; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.92rem; cursor: pointer; margin: 0.6rem 0; }
.checkbox-row input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); }
.filter-bar { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.6rem; }
.filter-bar .input { width: auto; min-width: 170px; flex: 0 1 auto; }

.flash { border-radius: var(--radius-sm); padding: 0.85rem 1.2rem; font-weight: 700; margin: 1.1rem 0; }
.flash-success { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.flash-error { background: var(--coral-soft); color: var(--coral); border: 1px solid var(--coral); }

/* ---------------- Auth ---------------- */
.auth-body { background: linear-gradient(150deg, #efe8ff, #ffeef6); min-height: 100vh; }
[data-theme="dark"] .auth-body { background: linear-gradient(150deg, #241d45, #2b1d3e); }
.auth-card-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.auth-card { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2.2rem 2.4rem; max-width: 460px; width: 100%; }
.auth-brand { margin-bottom: 1.4rem; }
.auth-sub { color: var(--ink-soft); }
.auth-alt { margin-top: 1rem; text-align: center; font-size: 0.93rem; }
.auth-foot { text-align: center; margin-top: 1.6rem; font-size: 0.9rem; }
.demo-hint { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 0.7rem 1rem; margin-top: 1rem; font-size: 0.9rem; text-align: center; }

/* ---------------- Misc / empty states ---------------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); }
.empty-emoji { font-size: 3.4rem; margin: 0; }
.pager { display: flex; gap: 0.4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pager-item { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; border: 2px solid var(--line); border-radius: 0.8rem; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 800; }
.pager-item.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-item.disabled { opacity: 0.4; pointer-events: none; }
.pager-gap { align-self: center; color: var(--ink-soft); }
.philosophy-band { background: linear-gradient(120deg, var(--primary), var(--pink)); color: #fff; border-radius: var(--radius); padding: 1.6rem 2rem; text-align: center; margin: 1.6rem 0; font-size: 1.15rem; line-height: 1.7; }
.philosophy-band strong { font-size: 1.15rem; }
.memory-assoc-box { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 0.9rem 0; }
.memory-assoc-label { font-weight: 800; margin-bottom: 0.2rem; }
.legal-prose h2 { font-size: 1.25rem; margin-top: 1.8rem; }
.legal-note { margin-top: 2rem; font-size: 0.9rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 1rem; }
.contact-info { margin-top: 1.5rem; color: var(--ink-soft); }

/* ---------------- Errors ---------------- */
.error-body { background: var(--cream); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.error-wrap { width: 100%; max-width: 560px; }
.error-card { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 3rem 2.4rem; text-align: center; }
.error-emoji { font-size: 4rem; margin: 0 0 0.6rem; }

/* ---------------- Confetti ---------------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti-piece { position: absolute; top: -6vh; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(115vh) rotate(720deg); opacity: 0.2; } }

/* ---------------- Toast ---------------- */
.edu-toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; border-radius: 999px; padding: 0.8rem 1.5rem;
  font-weight: 800; font-size: 0.95rem; box-shadow: var(--shadow-lg); z-index: 998;
  opacity: 0; transition: opacity 0.25s, transform 0.25s; max-width: 92vw; text-align: center;
}
.edu-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) { .edu-toast { bottom: 88px; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1280px) {
  .header-cta { display: none; }
  .nav-link { padding: 0.5rem 0.55rem; font-size: 0.88rem; }
}
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .hamburger { display: block; }
  .header-cta { display: none; }
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .number-grid, .number-grid-small { grid-template-columns: repeat(5, 1fr); }
  .achievement-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid-wide { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 560px; }
  .mindmap-strip-inner { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .play-card-grid { grid-template-columns: repeat(2, 1fr); }
  .syllable-grid { grid-template-columns: repeat(4, 1fr); }
  .word-grid-wide { grid-template-columns: repeat(4, 1fr); }
  .age-grid, .age-grid-big { grid-template-columns: 1fr; }
  .subject-grid, .subject-grid-big { grid-template-columns: repeat(2, 1fr); }
  .word-grid { grid-template-columns: repeat(4, 1fr); }
  .daily-strip { grid-template-columns: repeat(2, 1fr); }
  .parents-inner { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; grid-template-columns: 1fr 1fr; }
  .number-hero { grid-template-columns: 1fr; }
  .word-hero { grid-template-columns: 1fr; text-align: center; }
  .grid-side { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .rec-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .quiz-options.grid-2 { grid-template-columns: 1fr; }
  .footer-cta-inner { flex-direction: column; text-align: center; }
  .footer-cta-btns { justify-content: center; }
}
@media (max-width: 640px) {
  body { padding-bottom: 76px; }
  .mobile-bottom-nav { display: grid; }
  .topbar-note { display: none; }
  .topbar-actions { margin-left: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .subject-grid, .subject-grid-big { grid-template-columns: 1fr 1fr; }
  .word-grid { grid-template-columns: repeat(3, 1fr); }
  .number-grid, .number-grid-small { grid-template-columns: repeat(3, 1fr); }
  .daily-strip { grid-template-columns: 1fr 1fr; }
  .play-card-grid { grid-template-columns: 1fr; }
  .tone-card-grid { grid-template-columns: repeat(2, 1fr); }
  .syllable-grid { grid-template-columns: repeat(3, 1fr); }
  .word-grid-wide { grid-template-columns: repeat(2, 1fr); }
  .syllable-hero { grid-template-columns: 1fr; }
  .keypad { grid-template-columns: repeat(4, 1fr); }
  .stat-grid-wide { grid-template-columns: repeat(2, 1fr); }
  .achievement-grid { grid-template-columns: repeat(2, 1fr); }
  .article-side { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .child-switch { display: none; }
  .search-form { flex-direction: column; }
  .hero { padding: 2.2rem 0; }
  .section { padding: 2.4rem 0; }
  .game-card-grid { grid-template-columns: repeat(3, 1fr); }
  .recall-tile { width: 84px; }
  .math-visual .mobj { font-size: 1.5rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Professional English Words & Sentences Engine
   ============================================================ */
.phoneme-card { cursor: pointer; text-align: center; transition: transform .15s ease; }
.phoneme-card:hover { transform: translateY(-3px); }
.phoneme-card:active { transform: scale(.96); }

.family-suffix { background: var(--accent-soft, #fef3e2); font-weight: 700; }

.ws-grid { display: grid; grid-template-columns: repeat(8, 2.6rem); gap: .3rem; justify-content: center; margin: .5rem auto; }
.ws-cell { border: 1.5px solid var(--border, #d9d9d9); background: #fff; border-radius: 8px; padding: .45rem 0; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.ws-cell.ws-on { background: var(--accent, #f6a821); color: #fff; border-color: var(--accent, #f6a821); }

.order-slot { min-width: 5.5rem; text-align: center; }
.order-slot.order-filled { background: var(--accent, #f6a821); color: #fff; border-color: var(--accent, #f6a821); }

.game-big-option { font-size: 2.4rem; padding: .8rem 1.2rem; border: 2px solid var(--border, #d9d9d9); background: #fff; border-radius: 14px; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.game-big-option:hover { transform: translateY(-3px); border-color: var(--accent, #f6a821); }

.sight-card { cursor: default; }

/* word card extras */
.sg-badge { display: inline-block; background: #d4351c; color: #fff; border-radius: 999px; font-size: .68rem; padding: .1rem .45rem; margin-left: .35rem; vertical-align: middle; }

/* english game option tweaks on narrow screens */
@media (max-width: 640px) {
  .ws-grid { grid-template-columns: repeat(8, 1fr); }
  .ws-cell { padding: .3rem 0; font-size: .9rem; }
  .game-big-option { font-size: 1.8rem; }
}

/* ============================================================
   Language switcher (topbar) — defaults to English
   ============================================================ */
.lang-switch { position: relative; }
.lang-switch-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px; padding: 0.15rem 0.6rem; cursor: pointer;
  font-family: inherit; font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.lang-switch-btn:hover, .lang-switch-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.25); }
.lang-switch-caret { font-size: 0.7rem; opacity: 0.8; }
.lang-switch-menu {
  position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 80;
  min-width: 11.5rem; background: #fff; color: #1c2733;
  border: 1px solid var(--line); border-radius: 0.9rem;
  box-shadow: 0 12px 32px rgba(15, 30, 55, 0.18);
  padding: 0.35rem; overflow: hidden;
}
[data-theme="dark"] .lang-switch-menu { background: #16202e; color: #e8eef6; }
.lang-switch-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.7rem; border-radius: 0.6rem;
  text-decoration: none; color: inherit; font-weight: 700; font-size: 0.92rem;
}
.lang-switch-item:hover, .lang-switch-item:focus-visible { background: var(--tint); }
.lang-switch-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.lang-switch-item-flag { font-size: 1.15rem; }
.lang-native { font-weight: 600; opacity: 0.65; }

/* mobile menu language group */
.mobile-menu .mm-group-label {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.6; padding: 0.9rem 0.75rem 0.2rem;
}
.mobile-menu a.mm-active { color: var(--primary-strong); font-weight: 800; }

@media (max-width: 560px) {
  .lang-switch-label { display: none; }
  .lang-switch-menu { right: -1.5rem; }
}

/* ============================================================
   EduManual Premium — membership engine
   ============================================================ */
.premium-card { border: 2px solid var(--accent, #f6a821); box-shadow: 0 6px 24px rgba(246, 168, 33, 0.18); }

.mm-node {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: .5rem .9rem; border-radius: .8rem; color: #fff;
  font-weight: 800; font-size: 1rem; cursor: pointer; z-index: 2;
  box-shadow: 0 3px 10px rgba(15, 30, 55, .18);
  user-select: none; max-width: 10rem; text-align: center;
}
.mm-node-center { font-size: 1.25rem; padding: .8rem 1.3rem; z-index: 3; }
.mm-line {
  position: absolute; left: 50%; top: 50%;
  height: 3px; background: #c3ced9; border-radius: 2px;
  transform: translate(-50%, -50%); z-index: 1;
}

.tracing-sheet {
  min-height: 180px; background: var(--tint, #f7fafc);
  border: 2px dashed var(--line, #d9d9d9); border-radius: 1rem;
  display: flex; justify-content: center; align-items: center;
}

.challenge-card { transition: transform .15s ease; }
.challenge-card:has(button:hover) { transform: translateY(-2px); }

@media (max-width: 640px) {
  .mm-node { font-size: .85rem; padding: .4rem .6rem; }
}
