/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

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

/* ===== Design Tokens ===== */
:root {
  /* Brand — Deep Teal */
  --teal-50: #e6f5f5;
  --teal-100: #b3e0e0;
  --teal-200: #80cccc;
  --teal-400: #36b5ab;
  --teal-500: #0d7377;
  --teal-600: #0a5c5f;
  --teal-700: #074245;
  --teal-800: #053233;
  --teal-900: #032222;
  --teal-950: #021616;

  /* Accent — Gold */
  --gold-400: #d4a017;
  --gold-500: #b8860b;
  --gold-600: #9a7209;

  /* Neutrals — simple warm grays */
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --stone-950: #0c0a09;

  /* Semantic surfaces — light mode */
  --bg-page: #f5f5f4;
  --bg-surface: #ffffff;
  --bg-surface-alt: #fafaf9;
  --bg-header: #053233;
  --bg-child-view: #fffef7;
  --child-text-color: #1c1917;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-on-header: #ffffff;
  --border-color: #e7e5e4;

  /* Feedback */
  --green-50: #f0fdf4;
  --green-200: #bbf7d0;
  --green-500: #1a7a3a;
  --green-600: #15803d;
  --green-800: #14532d;
  --green-900-20: rgba(20, 83, 45, 0.2);

  --rose-50: #fef2f2;
  --rose-200: #fecaca;
  --rose-400: #e06c75;
  --rose-500: #c53030;
  --rose-600: #b91c1c;
  --rose-800: #7f1d1d;
  --rose-900-20: rgba(127, 29, 29, 0.2);

  --amber-50: #fffbeb;
  --amber-100-80: rgba(254, 243, 199, 0.8);
  --amber-400: #f59e0b;
  --amber-500: #d97706;
  --amber-600: #b45309;
  --amber-900-20: rgba(120, 53, 15, 0.2);

  /* Pointer */
  --dot-color: #dc2626;
  --dot-border: #ffffff;
  --track-color: #1c1917;

  /* Typography */
  --font-ui: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, sans-serif;
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-child: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radii — squared edges */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --transition-colors: color 0.2s, background-color 0.2s, border-color 0.2s;

  /* Layout */
  --container-max: 72rem;
  --header-height: 3.5rem;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --bg-page: #0c0a09;
  --bg-surface: #1c1917;
  --bg-surface-alt: #292524;
  --bg-header: #021616;
  --bg-child-view: #1c1917;
  --child-text-color: #f5f5f4;
  --text-primary: #e7e5e4;
  --text-secondary: #a8a29e;
  --border-color: #44403c;
  --dot-border: #1c1917;
  --track-color: #e7e5e4;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #0c0a09;
    --bg-surface: #1c1917;
    --bg-surface-alt: #292524;
    --bg-header: #021616;
    --bg-child-view: #1c1917;
    --child-text-color: #f5f5f4;
    --text-primary: #e7e5e4;
    --text-secondary: #a8a29e;
    --border-color: #44403c;
    --dot-border: #1c1917;
    --track-color: #e7e5e4;
  }
}

/* ===== Utilities ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Headings use serif font */
h1, h2, h3 { font-family: var(--font-heading); }

/* Base body readability */
body { font-size: 1rem; line-height: 1.65; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--teal-600);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 700;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus {
  top: var(--space-sm);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  color: var(--text-on-header);
  box-shadow: var(--shadow-md);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: var(--header-height);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: inherit;
  font-weight: 700;
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.site-header__logo svg { width: 1.25rem; height: 1.25rem; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Hamburger button */
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: inherit;
  border-radius: var(--radius-md);
  transition: background-color 0.2s;
}
.hamburger-btn:hover { background: rgba(255, 255, 255, 0.15); }

.page-lesson .hamburger-btn { display: none; }
.page-lesson .main-nav { display: none; }

/* Auto-hide header in lessons — slides up, peek area to pull down */
.page-lesson .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.page-lesson .site-header:hover,
.page-lesson .site-header.is-visible {
  transform: translateY(0);
}

/* Thin peek bar at top of lesson to hint the header is there */
.page-lesson::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-header);
  z-index: 49;
  cursor: pointer;
  transition: height 0.2s;
}
.page-lesson:hover::before {
  height: 0;
}

/* ===== Main Navigation ===== */
.main-nav {
  display: none;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
    align-items: center;
  }
}

.main-nav__list {
  display: flex;
  align-items: center;
  gap: 0;
}

.main-nav__link {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  height: var(--header-height);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.main-nav__link:hover,
.main-nav__link.is-active {
  color: #ffffff;
}

/* Active underline */
.main-nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.875rem;
  right: 0.875rem;
  height: 2px;
  background: var(--gold-400);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.main-nav__link:hover::after,
.main-nav__link.is-active::after {
  transform: scaleX(1);
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
  .hamburger-btn { display: none !important; }
}

/* ===== Hamburger Panel (Mobile) ===== */
.hamburger-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.hamburger-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hamburger-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(20rem, 85vw);
  background: var(--bg-surface);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}
.hamburger-panel[data-open="true"] {
  transform: translateX(0);
}

.hamburger-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.hamburger-panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hamburger-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}
.hamburger-panel__close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-alt);
}

.hamburger-panel__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) 0;
}

.hamburger-panel__list {
  display: flex;
  flex-direction: column;
}

.hamburger-panel__link {
  display: block;
  padding: 0.75rem var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition-colors);
}
.hamburger-panel__link:hover {
  background: var(--bg-surface-alt);
  color: var(--teal-600);
}
.hamburger-panel__link.is-active {
  color: var(--teal-600);
  border-left: 3px solid var(--teal-600);
  padding-left: calc(var(--space-lg) - 3px);
}

[data-theme="dark"] .hamburger-panel__link:hover { color: var(--teal-400); }
[data-theme="dark"] .hamburger-panel__link.is-active {
  color: var(--teal-400);
  border-left-color: var(--teal-400);
}

.hamburger-panel__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.hamburger-panel__cta {
  display: block;
  text-align: center;
  width: 100%;
}

@media (min-width: 768px) {
  .hamburger-overlay,
  .hamburger-panel { display: none !important; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  transition: var(--transition-colors);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.site-footer__heading {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-md);
}

.site-footer__about p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.site-footer__links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.site-footer__links a:hover {
  color: var(--teal-600);
}
[data-theme="dark"] .site-footer__links a:hover {
  color: var(--teal-400);
}

.site-footer__bottom {
  border-top: 1px solid var(--border-color);
  padding: var(--space-md);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.site-footer__bottom a {
  color: var(--teal-600);
  font-weight: 600;
}
.site-footer__bottom a:hover {
  color: var(--teal-700);
}
[data-theme="dark"] .site-footer__bottom a {
  color: var(--teal-400);
}

.site-footer__legal {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.625rem;
  font-weight: 400;
}

.site-footer__legal a {
  color: var(--text-secondary);
  font-weight: 400;
}
.site-footer__legal a:hover {
  color: var(--teal-600);
}
[data-theme="dark"] .site-footer__legal a:hover {
  color: var(--teal-400);
}

/* Hide footer on lesson pages */
.page-lesson .site-footer { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem var(--space-md);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.8125rem;
  transition: var(--transition-colors), transform 0.1s, box-shadow 0.2s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.btn:active { transform: scale(0.95); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* Primary — red (Move Dot) */
.btn--move {
  background: var(--dot-color);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--move:hover { background: #dc2626; color: #fff; }
.btn--move:active { background: #b91c1c; color: #fff; }

/* Warning — amber (Pause) */
.btn--pause {
  background: var(--amber-500);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--pause:hover { background: var(--amber-600); color: #fff; }

/* Neutral — slate (Reset) */
.btn--reset {
  background: var(--stone-200);
  color: var(--stone-700);
}
.btn--reset:hover { background: var(--stone-300); color: var(--stone-700); }

[data-theme="dark"] .btn--reset {
  background: var(--stone-700);
  color: var(--stone-200);
}
[data-theme="dark"] .btn--reset:hover {
  background: var(--stone-600);
  color: var(--stone-200);
}

/* Nav buttons — same size, strong contrast */
.btn--nav-prev,
.btn--nav-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--teal-600);
  background: var(--teal-600);
  color: #fff;
  transition: var(--transition-colors), transform 0.1s;
  cursor: pointer;
}
.btn--nav-prev:hover,
.btn--nav-next:hover {
  background: var(--teal-700);
  border-color: var(--teal-700);
  color: #fff;
}
.btn--nav-prev:active,
.btn--nav-next:active { transform: scale(0.95); }
.btn--nav-prev:disabled,
.btn--nav-next:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

[data-theme="dark"] .btn--nav-prev,
[data-theme="dark"] .btn--nav-next {
  background: var(--teal-500);
  border-color: var(--teal-500);
}
[data-theme="dark"] .btn--nav-prev:hover,
[data-theme="dark"] .btn--nav-next:hover {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: #fff;
}

/* Theme toggle */
.theme-toggle {
  padding: 0.375rem;
  border-radius: var(--radius-full);
  transition: background-color 0.2s;
  color: inherit;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}
.theme-toggle svg { width: 1rem; height: 1rem; }

/* Toggle pointer visibility */
.btn-toggle-pointer {
  color: var(--text-secondary);
  padding: 0.375rem;
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}
.btn-toggle-pointer:hover {
  color: var(--teal-600);
  background: var(--stone-100);
}
[data-theme="dark"] .btn-toggle-pointer:hover {
  color: var(--teal-400);
  background: var(--stone-800);
}

/* CTA — Gold accent (dark text for contrast) */
.btn--cta {
  background: var(--gold-400);
  color: #1c1917;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.btn--cta:hover {
  background: var(--gold-500);
  color: #1c1917;
}
.btn--cta:active { transform: scale(0.97); }

/* Outline */
.btn--outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
}
.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* ===== Lesson Card (Dashboard Grid) ===== */
.lesson-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-colors), box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  position: relative;
}

.lesson-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--teal-200);
}
[data-theme="dark"] .lesson-card:hover {
  border-color: var(--teal-800);
}

.lesson-card__number {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--teal-50);
  color: var(--teal-600);
  font-weight: 800;
  font-size: 1rem;
}
[data-theme="dark"] .lesson-card__number {
  background: var(--teal-950);
  color: var(--teal-400);
}

.lesson-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.lesson-card__target {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-family: var(--font-child);
}

/* Completed state */
.lesson-card.is-complete {
  border-color: var(--green-200);
}
.lesson-card.is-complete .lesson-card__number {
  background: var(--green-50);
  color: var(--green-600);
}
[data-theme="dark"] .lesson-card.is-complete .lesson-card__number {
  background: var(--green-900-20);
  color: var(--green-500);
}

.lesson-card__check {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  color: var(--green-500);
  transition: opacity 0.15s;
}
.lesson-card__check svg { width: 1rem; height: 1rem; }

.lesson-card__reset {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-400);
  background: none;
  border: none;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  cursor: pointer;
}
/* On hover: hide check, show reset */
.lesson-card:hover .lesson-card__check { opacity: 0; }
.lesson-card:hover .lesson-card__reset { opacity: 1; }
.lesson-card__reset:hover { color: var(--rose-500); }

/* Parent Guide Card */
.parent-guide {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  transition: var(--transition-colors);
}

.parent-guide__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.parent-guide__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 768px) {
  .parent-guide__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.parent-guide__section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}
[data-theme="dark"] .parent-guide__section-title {
  color: var(--teal-400);
}

.parent-guide__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.parent-guide__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-primary);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.parent-guide__item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.parent-guide__item--praise {
  background: var(--green-50);
  border-color: var(--green-200);
}
.parent-guide__item--praise svg { color: var(--green-600); }
[data-theme="dark"] .parent-guide__item--praise {
  background: var(--green-900-20);
  border-color: rgba(22, 101, 52, 0.3);
}

.parent-guide__item--correct {
  background: var(--rose-50);
  border-color: var(--rose-200);
}
.parent-guide__item--correct svg { color: var(--rose-600); }
[data-theme="dark"] .parent-guide__item--correct {
  background: var(--rose-900-20);
  border-color: rgba(159, 18, 57, 0.3);
}

.parent-guide__pointer-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-primary);
}
.parent-guide__pointer-item svg {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  color: var(--teal-500);
}
.parent-guide__pointer-item b {
  font-weight: 700;
}

/* ===== Pointer / Red Dot ===== */
.pointer-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  margin-top: 0.25rem;
  opacity: 1;
  transition: opacity 0.3s;
}

/* Arrow track */
.cue-arrow {
  position: relative;
  display: none;
  align-items: center;
  width: 100%;
  height: 100%;
}

.cue-arrow.is-active { display: flex; }

.arrow-line {
  height: 4px;
  position: relative;
  background-color: var(--track-color);
  transition: width 0.3s ease;
}

.arrow-head {
  position: absolute;
  right: -10px;
  top: -6px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--track-color);
}

/* Arrow start dot */
.arrow-start-dot {
  width: 1rem;
  height: 1rem;
  background: var(--track-color);
  border-radius: var(--radius-full);
  position: absolute;
  left: -8px;
  top: 50%;
  margin-top: -8px;
  z-index: 10;
  transition: var(--transition-colors);
}

/* Stop dot */
.cue-stop {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.cue-stop.is-active { display: flex; }

.stop-dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--radius-full);
  background: var(--track-color);
}

/* The red finger dot */
.finger-dot {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--dot-color);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--dot-border);
  box-shadow: var(--shadow-sm);
  position: absolute;
  left: -10px;
  top: 50%;
  margin-top: -10px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.finger-dot.is-visible { opacity: 1; }
.finger-dot.is-hidden { opacity: 0; pointer-events: none; }

/* Speed slider (used in lesson compact remote) */
.speed-control__slider {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  appearance: none;
  -webkit-appearance: none;
  background: var(--stone-200);
  cursor: pointer;
  accent-color: var(--teal-600);
}
[data-theme="dark"] .speed-control__slider {
  background: var(--stone-700);
  accent-color: var(--teal-400);
}

/* ===== Orthography Engine ===== */
/* Visual prompting system aligned with Funnix/Direct Instruction methodology */

/* Child view font */
.school-font {
  font-family: var(--font-child);
  letter-spacing: 0.05em;
}

/* Spacing helpers for blending */
.blend-space { margin: 0 0.3em; }
.review-space { margin: 0 0.8em; }

/* === Funnix Type 1: Underlined Letter Combinations === */
/* Shows unique sounds for letter combos (sh, th, ch, wh, er, ar, oo, ing, ea, ai, ou) */
.digraph {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-decoration-color: var(--stone-400);
  text-underline-offset: 0.15em;
}

/* === Funnix Type 2: Letter-Name Combinations (Together) === */
/* Adjacent letters where one says its name and the other is silent */
/* e.g., in "paint": a says its name (letter-name), i is silent (silent-partner) */
.letter-name {
  font-weight: 800;
  color: var(--text-primary);
}
.silent-partner {
  opacity: 0.4;
  font-weight: 400;
}

/* === Funnix Type 3: Letter-Name Combinations (Separated) === */
/* Silent letters are smaller and faded to show they don't say anything */
.silent {
  opacity: 0.3;
  font-size: 0.7em;
  vertical-align: baseline;
}

/* === Funnix Type 4: Irregular Word Parts === */
/* Squiggly underline for parts that don't follow learned rules */
/* e.g., the "ai" in "said" doesn't make the typical long-a sound */
.irregular {
  text-decoration: underline wavy;
  text-decoration-color: var(--rose-400);
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.06em;
}

/* === Long vowel macron via CSS (preserves the letter shape) === */
/* Use <span class="macron">i</span> instead of Unicode ī */
.macron {
  position: relative;
  display: inline-block;
}
.macron::after {
  content: "";
  position: absolute;
  top: -0.05em;
  left: 0.05em;
  right: 0.05em;
  height: 0.08em;
  background: currentColor;
}

/* Highlighted word in story reading */
.word-focus {
  color: var(--dot-color);
}

/* ===== Home Page ===== */

/* Hero */
.hero {
  background: var(--bg-header);
  color: var(--text-on-header);
  padding: var(--space-3xl) var(--space-md);
  text-align: center;
}

.hero__inner {
  max-width: 40rem;
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: clamp(0.9375rem, 2vw, 1.125rem);
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections */
.home-section {
  padding: var(--space-3xl) var(--space-md);
}

.home-section--alt {
  background: var(--bg-surface);
}

.home-section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.home-section__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.home-section__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Method cards (How It Works) */
.method-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .method-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.method-card {
  text-align: center;
  padding: var(--space-lg);
}

.method-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: var(--teal-50);
  color: var(--teal-700);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: var(--space-md);
}
[data-theme="dark"] .method-card__number {
  background: var(--teal-950);
  color: var(--teal-400);
}

.method-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.method-card__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Phase cards */
.phase-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .phase-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .phase-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.phase-card {
  display: block;
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  transition: var(--transition-colors), box-shadow 0.2s, transform 0.15s;
}
.phase-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--teal-200);
}
[data-theme="dark"] .phase-card {
  background: var(--bg-surface-alt);
}
[data-theme="dark"] .phase-card:hover {
  border-color: var(--teal-800);
}

.phase-card__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal-700);
  background: var(--teal-50);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
[data-theme="dark"] .phase-card__badge {
  color: var(--teal-400);
  background: var(--teal-950);
}

.phase-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.phase-card__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Dashboard Page ===== */
.dashboard {
  flex-grow: 1;
  padding: var(--space-md) var(--space-md);
  width: 100%;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .dashboard {
    padding: var(--space-xl);
  }
}

.dashboard__inner {
  max-width: 64rem;
  margin: 0 auto;
}

/* Phase section */
.phase-section {
  margin-bottom: var(--space-xl);
}

.phase-section + .phase-section {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.phase-section__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}
.phase-section__title a {
  color: inherit;
  text-decoration: none;
}
.phase-section__title a:hover {
  color: var(--teal-600);
}
[data-theme="dark"] .phase-section__title a:hover {
  color: var(--teal-400);
}

.phase-section__subtitle {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

/* Lesson grid */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .lesson-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .lesson-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Progress export/import */
.progress-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.progress-actions__title {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.btn--progress {
  font-size: 0.75rem;
  padding: 0.375rem var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition-colors);
}
.btn--progress:hover {
  border-color: var(--teal-200);
  background: var(--teal-50);
}
[data-theme="dark"] .btn--progress:hover {
  border-color: var(--teal-800);
  background: var(--teal-950);
}

/* Hidden file input for import */
.progress-import-input { display: none; }

/* Stories section link */
.stories-link-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.stories-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-colors), box-shadow 0.2s, transform 0.15s;
}
.stories-link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--teal-200);
}
.stories-link svg { width: 1.25rem; height: 1.25rem; color: var(--teal-500); }

/* ===== Student Profile Selector ===== */
.profile-selector {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
}

.profile-selector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.profile-selector__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.profile-selector__add {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal-600);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--teal-200);
  background: none;
  transition: var(--transition-colors);
}
.profile-selector__add:hover {
  background: var(--teal-50);
}
[data-theme="dark"] .profile-selector__add {
  color: var(--teal-400);
  border-color: var(--teal-800);
}
[data-theme="dark"] .profile-selector__add:hover {
  background: var(--teal-950);
}

.profile-selector__empty {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-style: italic;
}

.profile-selector__list {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.profile-item {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  transition: var(--transition-colors);
}

.profile-item.is-active {
  border-color: var(--teal-500);
  background: var(--teal-50);
}
[data-theme="dark"] .profile-item.is-active {
  background: var(--teal-950);
  border-color: var(--teal-700);
}

.profile-item__select {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem 0.75rem;
  background: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: var(--transition-colors);
  text-align: left;
}
.profile-item__select:hover {
  background: var(--bg-surface-alt);
}

.profile-item__count {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.profile-item__delete {
  padding: 0.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  background: none;
  border-left: 1px solid var(--border-color);
  transition: var(--transition-colors);
}
.profile-item__delete:hover {
  color: var(--rose-500);
  background: var(--rose-50);
}
[data-theme="dark"] .profile-item__delete:hover {
  background: var(--rose-900-20);
}

/* ===== Content Pages (Parent Guide, About, Contact) ===== */
.content-page {
  padding: var(--space-2xl) var(--space-md);
}

.content-page__inner {
  max-width: 48rem;
  margin: 0 auto;
}

.content-page__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.content-page__intro {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-2xl);
}

.content-page__cta {
  text-align: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

/* Guide sections */
.guide-section {
  margin-bottom: var(--space-2xl);
}

.guide-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--teal-200);
}
[data-theme="dark"] .guide-section__title {
  border-bottom-color: var(--teal-800);
}

.guide-section p {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.guide-section a {
  color: var(--teal-600);
  font-weight: 600;
}
.guide-section a:hover { text-decoration: underline; }
[data-theme="dark"] .guide-section a { color: var(--teal-400); }

/* Guide cards grid */
.guide-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .guide-cards { grid-template-columns: 1fr 1fr; }
}

.guide-card {
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-alt);
}

.guide-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--teal-700);
  margin-bottom: var(--space-sm);
}
[data-theme="dark"] .guide-card__title { color: var(--teal-400); }

.guide-card p {
  font-size: 0.8125rem;
  margin-bottom: 0;
}

/* Feedback row */
.guide-feedback-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .guide-feedback-row { grid-template-columns: 1fr 1fr; }
}

.guide-feedback {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.guide-feedback h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.guide-feedback p {
  font-size: 0.8125rem;
}

.guide-feedback--praise {
  background: var(--green-50);
  border: 1px solid var(--green-200);
}
.guide-feedback--praise h3 { color: var(--green-600); }
[data-theme="dark"] .guide-feedback--praise {
  background: var(--green-900-20);
  border-color: rgba(20, 83, 45, 0.3);
}

.guide-feedback--correct {
  background: var(--rose-50);
  border: 1px solid var(--rose-200);
}
.guide-feedback--correct h3 { color: var(--rose-600); }
[data-theme="dark"] .guide-feedback--correct {
  background: var(--rose-900-20);
  border-color: rgba(127, 29, 29, 0.3);
}

/* Tips list */
.guide-tips {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.guide-tips li {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.6;
  padding-left: var(--space-md);
  position: relative;
}

.guide-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--teal-500);
}

/* Keyboard shortcut grid */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}
@media (min-width: 480px) {
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.shortcut-item kbd {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.shortcut-item span {
  color: var(--text-secondary);
}

/* ===== Sound Chart Table ===== */
.sound-chart-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sound-chart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.sound-chart thead {
  background: var(--bg-surface-alt);
  position: sticky;
  top: 0;
}

.sound-chart th {
  text-align: left;
  padding: 0.625rem var(--space-md);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.sound-chart td {
  padding: 0.5rem var(--space-md);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.sound-chart tbody tr:hover {
  background: var(--bg-surface-alt);
}

.sound-chart__symbol {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 3rem;
}

.sound-chart__pronounced {
  font-family: var(--font-ui);
  color: var(--text-secondary);
  font-style: italic;
}

.sound-chart__asin {
  color: var(--text-primary);
}

.sound-chart__note {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-style: italic;
}

.sound-chart__type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.sound-chart__type--voiced { color: var(--teal-600); }
.sound-chart__type--whispered { color: var(--stone-500); }

[data-theme="dark"] .sound-chart__type--voiced { color: var(--teal-400); }

.sound-chart__lesson a {
  color: var(--teal-600);
  font-weight: 600;
}
.sound-chart__lesson a:hover { text-decoration: underline; }
[data-theme="dark"] .sound-chart__lesson a { color: var(--teal-400); }

/* ===== Word List / Stories Filters ===== */
.wordlist-filters,
.stories-filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.wordlist-filter,
.stories-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wordlist-filter__label,
.stories-filter__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.wordlist-filter__select,
.stories-filter__select,
.wordlist-filter__input {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-ui);
  min-width: 8rem;
}

.wordlist-filter__input { min-width: 12rem; }

.wordlist-count,
.stories-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding-bottom: 0.375rem;
}

.wordlist-sounds {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-ui);
}

.wordlist-note {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Phase word cloud */
.phase-word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.phase-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
}

.phase-word__text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.phase-word__lesson {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--teal-600);
}
[data-theme="dark"] .phase-word__lesson { color: var(--teal-400); }

/* Phase story cards with word lists */
.phase-stories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.phase-story-card {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.phase-story-card__link {
  display: block;
  padding: var(--space-md) var(--space-lg);
  transition: background-color 0.15s;
}
.phase-story-card__link:hover {
  background: var(--bg-surface-alt);
}

.phase-story-card__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.phase-story-card__desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.phase-story-card__words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
}

.phase-story-card__word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.phase-story-card__wlesson {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--teal-600);
}
[data-theme="dark"] .phase-story-card__wlesson { color: var(--teal-400); }

/* ===== Curriculum Stats ===== */
.curriculum-stats {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-2xl);
}

.curriculum-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  min-width: 6rem;
}

.curriculum-stat__number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--teal-600);
  line-height: 1;
}
[data-theme="dark"] .curriculum-stat__number { color: var(--teal-400); }

.curriculum-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ===== Roadmap ===== */
.roadmap-phase {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}
.roadmap-phase:last-child { border-bottom: none; }

.roadmap-phase__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
}

.roadmap-phase__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.roadmap-phase__title a { color: var(--text-primary); }
.roadmap-phase__title a:hover { color: var(--teal-600); }
[data-theme="dark"] .roadmap-phase__title a:hover { color: var(--teal-400); }

.roadmap-phase__meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.roadmap-phase__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

/* Lesson dots track */
.roadmap-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: flex-start;
}

.roadmap-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  width: 2.25rem;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: transform 0.1s;
}
.roadmap-dot:hover { transform: scale(1.15); }

.roadmap-dot__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  background: var(--stone-200);
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 700;
}
[data-theme="dark"] .roadmap-dot__number {
  background: var(--stone-700);
  color: var(--stone-300);
}

/* Milestone dots (new sound introduced) */
.roadmap-dot--milestone .roadmap-dot__number {
  background: var(--teal-600);
  color: #fff;
}
[data-theme="dark"] .roadmap-dot--milestone .roadmap-dot__number {
  background: var(--teal-500);
}

.roadmap-dot__sound {
  font-size: 0.625rem;
  font-weight: 700;
  font-family: var(--font-child);
  color: var(--teal-700);
  text-align: center;
  line-height: 1;
}
[data-theme="dark"] .roadmap-dot__sound { color: var(--teal-400); }

/* Stories in roadmap */
.roadmap-stories {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
  font-size: 0.8125rem;
}

.roadmap-stories__label {
  font-weight: 700;
  color: var(--text-secondary);
}

.roadmap-stories__link {
  color: var(--teal-600);
  font-weight: 600;
}
.roadmap-stories__link:hover { text-decoration: underline; }
[data-theme="dark"] .roadmap-stories__link { color: var(--teal-400); }

/* About and Contact pages use content-page styles from parent-guide.css */

/* Contact page uses content-page styles from parent-guide.css */

/* ===== Lesson Page (Top/Bottom Layout) ===== */
.lesson-shell {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

/* === Child View (always on top) === */
.lesson-child {
  flex: 0 0 auto;
  min-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-child-view);
  padding: var(--space-md);
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.lesson-child__display-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.child-text {
  font-size: clamp(3rem, 15vw, 8.75rem);
  line-height: 1.15;
  font-weight: 700;
  font-family: var(--font-child);
  letter-spacing: 0.05em;
  color: var(--child-text-color, #1c1917);
  user-select: none;
  pointer-events: none;
  padding-bottom: var(--space-sm);
  text-align: center;
  white-space: pre-wrap;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
}

.child-text--story {
  font-size: clamp(1.5rem, 6vw, 3rem);
  line-height: 1.4;
}

/* === Teacher Panel (compact, always on bottom) === */
.lesson-teacher {
  flex: 1;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition-colors);
  border-top: 2px solid var(--teal-600);
}

[data-theme="dark"] .lesson-teacher {
  border-top-color: var(--teal-700);
}

/* Lesson/Phase info bar */
.lesson-info-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lesson-info-bar__top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lesson-info-bar__steps {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lesson-info-bar__phase {
  color: var(--teal-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme="dark"] .lesson-info-bar__phase { color: var(--teal-400); }

.lesson-info-bar__lesson { color: var(--text-primary); }
.lesson-info-bar__target { color: var(--text-secondary); font-family: var(--font-child); }
.lesson-info-bar__sep { color: var(--stone-300); }
[data-theme="dark"] .lesson-info-bar__sep { color: var(--stone-600); }

.lesson-info-bar__dots {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.lesson-teacher__body {
  flex-grow: 1;
  padding: var(--space-sm) var(--space-md);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

@media (min-width: 768px) {
  .lesson-teacher__body {
    padding: var(--space-md) var(--space-xl);
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
  }
}

/* Custom scrollbar */
.lesson-teacher__body::-webkit-scrollbar { width: 4px; }
.lesson-teacher__body::-webkit-scrollbar-track { background: transparent; }
.lesson-teacher__body::-webkit-scrollbar-thumb {
  background: var(--stone-300);
  border-radius: 10px;
}
[data-theme="dark"] .lesson-teacher__body::-webkit-scrollbar-thumb {
  background: var(--stone-600);
}

/* Step dots and step number are now in .lesson-info-bar */

.step-dots {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.step-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: var(--stone-300);
  transition: var(--transition-colors);
}
.step-dot.is-active { background: var(--teal-600); }
.step-dot.is-done { background: var(--green-500); }
[data-theme="dark"] .step-dot { background: var(--stone-600); }
[data-theme="dark"] .step-dot.is-active { background: var(--teal-400); }

.step-number {
  font-size: 0.6875rem;
  color: var(--teal-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme="dark"] .step-number { color: var(--teal-400); }

/* Say script */
.step-say {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 400;
  color: var(--text-primary);
  font-family: Georgia, 'Times New Roman', serif;
}

.step-do {
  display: inline-flex;
  align-items: flex-start;
  background: var(--amber-50);
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--amber-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
  text-align: left;
}
[data-theme="dark"] .step-do {
  background: var(--amber-900-20);
  border-left-color: var(--amber-600);
}

/* Do instruction stretches full width under script */

.step-do__icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--amber-600);
  flex-shrink: 0;
  margin-right: var(--space-xs);
  margin-top: 0.125rem;
}
[data-theme="dark"] .step-do__icon { color: var(--amber-500); }

.step-do__text {
  font-size: 0.75rem;
  color: var(--stone-700);
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
}
[data-theme="dark"] .step-do__text { color: rgba(254, 243, 199, 0.8); }

/* Feedback boxes — stacked (praise, then correct), centered */
.feedback-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  min-height: 0;
}

.feedback-box {
  display: none;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  text-align: left;
}
.feedback-box.is-visible { display: flex; }

.feedback-box svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; margin-top: 0.125rem; }

.feedback-box__text {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.feedback-box--praise { background: var(--green-50); border: 1px solid var(--green-200); }
.feedback-box--praise svg { color: var(--green-600); }
.feedback-box--praise .feedback-box__text { color: var(--green-800); }
[data-theme="dark"] .feedback-box--praise { background: var(--green-900-20); border-color: rgba(20, 83, 45, 0.4); }
[data-theme="dark"] .feedback-box--praise .feedback-box__text { color: #bbf7d0; }

.feedback-box--correct { background: var(--rose-50); border: 1px solid var(--rose-200); }
.feedback-box--correct svg { color: var(--rose-600); }
.feedback-box--correct .feedback-box__text { color: var(--rose-800); }
[data-theme="dark"] .feedback-box--correct { background: var(--rose-900-20); border-color: rgba(127, 29, 29, 0.4); }
[data-theme="dark"] .feedback-box--correct .feedback-box__text { color: #fecaca; }

/* Pointer remote controls */
.pointer-remote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}

/* Back / Next nav */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
}

/* Exit lesson button (icon only) */
.lesson-exit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.lesson-exit-btn:hover { color: var(--rose-500); }

/* Theme toggle in lesson nav row */
.lesson-theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.lesson-theme-toggle:hover { color: var(--text-primary); }

.pointer-remote .btn { padding: 0.375rem; }
.pointer-remote .speed-control {
  flex: 0 0 5rem;
  margin: 0;
  padding: 0 var(--space-xs);
  border: none;
  background: none;
}

/* ===== Second Reading + Comprehension ===== */
.second-reading {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  background: var(--bg-surface);
}

.second-reading__inner {
  max-width: 40rem;
  width: 100%;
  text-align: center;
}

.second-reading__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-600);
  margin-bottom: var(--space-xs);
}
[data-theme="dark"] .second-reading__title { color: var(--teal-400); }

.second-reading__instruction {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.second-reading__text {
  font-size: 1.75rem;
  line-height: 2;
  color: var(--text-primary);
  padding: var(--space-xl);
  background: var(--bg-child-view);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-xl);
  text-align: left;
}
[data-theme="dark"] .second-reading__text {
  background: var(--bg-surface-alt);
}

/* Faded prompts in second reading — remove all visual aids */
.second-reading__text .digraph { text-decoration: none; }
.second-reading__text .silent { opacity: 1; font-size: inherit; }
.second-reading__text .silent-partner { opacity: 1; }
.second-reading__text .letter-name { font-weight: inherit; }
.second-reading__text .irregular { text-decoration: none; }
.second-reading__text .word-focus { color: inherit; }

.second-reading__subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.comprehension-q {
  text-align: left;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
}

.comprehension-q__question {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.comprehension-q__answer {
  display: none;
  font-size: 0.875rem;
  color: var(--teal-600);
  font-weight: 600;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-color);
}
[data-theme="dark"] .comprehension-q__answer { color: var(--teal-400); }

.comprehension-q__reveal {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  margin-top: var(--space-sm);
}
.comprehension-q__reveal:hover { border-color: var(--teal-500); }

.second-reading__actions {
  margin-top: var(--space-xl);
}

/* ===== Keyboard Shortcut Overlay ===== */
.shortcut-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-overlay__panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 28rem;
  width: 90vw;
  box-shadow: var(--shadow-xl);
}

.shortcut-overlay__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.shortcut-overlay__grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  font-size: 0.8125rem;
}

.shortcut-overlay__key {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  min-width: 2rem;
}

.shortcut-overlay__desc {
  color: var(--text-secondary);
  line-height: 1.8;
}

.shortcut-overlay__close {
  display: block;
  margin-top: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Print Stylesheet ===== */
@media print {
  .site-header,
  .site-footer,
  .pointer-remote,
  .pointer-container,
  .step-nav,
  .step-dots,
  .keyboard-hint,
  .teacher-top-row { display: none !important; }

  .lesson-shell {
    display: block !important;
  }

  .lesson-child {
    flex: none;
    border: none;
    padding: var(--space-md);
  }

  .lesson-teacher { break-inside: avoid; border-top: none; }
  .lesson-teacher__body { overflow: visible; padding: var(--space-md); }

  .step[aria-hidden="true"] {
    display: block !important;
    border-bottom: 1px solid #ccc;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
  }

  .feedback-box { display: flex !important; }
}

/* ===== Story Page ===== */
.story-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.story-page__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal-600);
  margin-bottom: var(--space-lg);
}
.story-page__back:hover { text-decoration: underline; }
.story-page__back svg { width: 1rem; height: 1rem; }

[data-theme="dark"] .story-page__back { color: var(--teal-400); }

.story-page__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.story-page__meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.story-page__content {
  font-family: var(--font-child);
  font-size: 2rem;
  line-height: 2;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.story-page__content p {
  margin-bottom: var(--space-lg);
}

.story-page__content strong {
  color: var(--teal-600);
  font-weight: 700;
}
[data-theme="dark"] .story-page__content strong {
  color: var(--teal-400);
}

/* Story comprehension */
.story-comprehension {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.story-comprehension__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* Story word list */
.story-words {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.story-words__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.story-words__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.story-words__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
}

.story-words__word {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.story-words__lesson {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--teal-600);
}
[data-theme="dark"] .story-words__lesson { color: var(--teal-400); }

/* Story nav (prev/next) */
.story-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.story-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: var(--transition-colors), border-color 0.2s;
  flex: 1;
  max-width: 50%;
}
.story-nav__link:hover {
  border-color: var(--teal-500);
  background: var(--bg-surface-alt);
}

.story-nav__link--next {
  text-align: right;
  justify-content: flex-end;
}

.story-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--teal-600);
}
.story-nav__link:hover .story-nav__arrow { color: var(--teal-500); }
[data-theme="dark"] .story-nav__arrow { color: var(--teal-400); }

.story-nav__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.story-nav__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.story-nav__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Stories index */
.stories-index {
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.stories-index__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.stories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.story-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-colors), box-shadow 0.2s, transform 0.15s;
}
.story-list-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--teal-200);
}

.story-list-item__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.story-list-item__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.story-list-item__icon {
  width: 2rem;
  height: 2rem;
  color: var(--teal-500);
  flex-shrink: 0;
}

