:root {
  color-scheme: dark;
  --bg: #07101d;
  --surface: rgba(16, 28, 47, .82);
  --surface-2: rgba(21, 36, 59, .92);
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(133, 195, 255, .22);
  --text: #f5f9ff;
  --muted: #93a4bb;
  --accent: #6ee7ff;
  --accent-2: #8b7cff;
  --success: #59e0a3;
  --danger: #ff8e9d;
  --warning: #ffd27a;
  --shadow: 0 28px 70px rgba(0,0,0,.34);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 154, 255, .12), transparent 32%),
    radial-gradient(circle at 100% 20%, rgba(139, 124, 255, .12), transparent 30%),
    var(--bg);
  overflow-x: hidden;
}

button, input, select { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(110,231,255,.34);
  outline-offset: 2px;
}

.page-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: .16;
  z-index: -1;
}

.page-glow-one { top: -130px; left: -100px; background: #4f9aff; }
.page-glow-two { right: -180px; top: 300px; background: #8b7cff; }

.app-shell {
  width: min(1180px, calc(100% - 34px));
  margin: 0 auto;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-weight: 900;
  color: #07101d;
  background: linear-gradient(135deg, var(--accent), #c8f8ff);
  box-shadow: 0 10px 28px rgba(110,231,255,.16);
}

.brand strong,
.brand small { display: block; }

.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.status-pill,
.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #cfe5f7;
  background: rgba(255,255,255,.045);
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 16px rgba(89,224,163,.7);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 28px;
  align-items: stretch;
  padding: 58px 0 36px;
}

.eyebrow,
.section-label,
.side-label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), #bdacff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy > p {
  max-width: 680px;
  margin: 0;
  color: #b1c0d3;
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions,
.button-row,
.listening-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.primary,
.secondary,
.ghost,
.play-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
}

.primary {
  color: #06111c;
  background: linear-gradient(135deg, var(--accent), #bdefff);
  box-shadow: 0 14px 34px rgba(110,231,255,.12);
}

.secondary,
.ghost,
.play-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.055);
}

.ghost:hover,
.secondary:hover,
.play-button:hover {
  border-color: var(--border-strong);
  background: rgba(255,255,255,.08);
}

.hero-card,
.mode-nav,
.mode-content,
.study-card,
.score-strip {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22,37,61,.92), rgba(10,20,35,.86));
}

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 17px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

.mini-stat span { color: var(--muted); font-size: 13px; }
.mini-stat strong { font-size: 22px; }

.hero-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hero-note p { margin: 0; }

.workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  padding-bottom: 50px;
}

.mode-nav {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(11, 22, 38, .78);
  position: sticky;
  top: 18px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 15px;
  text-align: left;
  background: transparent;
}

.mode-btn:hover { background: rgba(255,255,255,.04); }

.mode-btn.active {
  border-color: rgba(110,231,255,.18);
  background: linear-gradient(135deg, rgba(110,231,255,.11), rgba(139,124,255,.08));
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}

.mode-btn strong,
.mode-btn small { display: block; }

.mode-btn strong { font-size: 14px; }
.mode-btn small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.side-card {
  margin-top: 5px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.side-card strong {
  display: block;
  margin: 6px 0;
  font-size: 13px;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.ai-dot {
  background: #8b7cff;
  box-shadow: 0 0 12px rgba(139,124,255,.7);
}

.local-ai-card {
  margin-top: 12px;
}

.local-ai-chat {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-top: 12px;
  padding: 8px 0 0;
}

.local-ai-message {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
}

.local-ai-message.ai {
  border-color: rgba(110,231,255,.16);
  background: rgba(110,231,255,.04);
}

.local-ai-message.user {
  border-color: rgba(139,124,255,.18);
  background: rgba(139,124,255,.05);
}

.local-ai-message strong {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.local-ai-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.local-ai-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  color: var(--text);
}

.local-ai-form textarea::placeholder {
  color: var(--muted);
}

.local-ai-form button {
  width: 100%;
}

.mode-content {
  min-height: 610px;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,28,47,.86), rgba(9,18,32,.82));
}

.panel { display: none; }
.panel.active-panel { display: block; animation: reveal .22s ease; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: -.035em;
}

.progress-track {
  height: 7px;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

.study-card {
  padding: 34px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(110,231,255,.08), transparent 34%),
    rgba(10,21,37,.72);
}

.listen-orb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border: 1px solid rgba(110,231,255,.18);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(110,231,255,.10), rgba(139,124,255,.08));
  box-shadow: 0 0 0 12px rgba(110,231,255,.025);
  font-size: 28px;
}

.listen-orb.large {
  width: 96px;
  height: 96px;
  font-size: 34px;
}

.play-button {
  min-width: 180px;
  margin-top: 14px;
}

.helper {
  max-width: 520px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.helper.wide { max-width: 650px; }

.input-block {
  max-width: 590px;
  margin: 30px auto 0;
  text-align: left;
}

.input-block label,
.settings-grid label {
  display: grid;
  gap: 8px;
  color: #cbd8e8;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(4,12,23,.75);
}

input {
  min-height: 57px;
  padding: 0 16px;
  font-size: 18px;
}

select {
  min-height: 46px;
  padding: 0 12px;
}

input::placeholder { color: #617086; }

.study-card > .button-row,
.listening-controls {
  justify-content: center;
}

.result-card {
  max-width: 590px;
  margin: 22px auto 0;
  padding: 17px;
  border-radius: 15px;
  text-align: left;
  line-height: 1.55;
}

.result-card.correct {
  border: 1px solid rgba(89,224,163,.22);
  background: rgba(89,224,163,.08);
}

.result-card.wrong {
  border: 1px solid rgba(255,142,157,.22);
  background: rgba(255,142,157,.08);
}

.result-card strong { display: block; margin-bottom: 4px; }

.secondary-actions { justify-content: center; }

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 17px;
  background: var(--border);
}

.score-strip > div {
  padding: 15px 18px;
  background: rgba(9,18,32,.96);
}

.score-strip span,
.score-strip strong { display: block; }

.score-strip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.score-strip strong { margin-top: 5px; font-size: 14px; }

.listening-card h3 {
  margin: 14px 0 0;
  font-size: 28px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 650px;
  margin: 28px auto 0;
  text-align: left;
}

.tiny-note {
  max-width: 660px;
  margin: 18px auto 0;
  color: #75859a;
  font-size: 11px;
  line-height: 1.55;
}

.review-area {
  max-width: 650px;
  margin: 26px auto 0;
  text-align: left;
}

.review-question {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(255,255,255,.025);
}

.review-question h3 { margin: 0 0 7px; }
.review-question p { margin: 0 0 15px; color: var(--muted); }

.review-question input { margin-bottom: 12px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 0 42px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
}

footer strong {
  color: #dce9f8;
  margin-right: 8px;
}

footer p { margin: 0; text-align: right; }

.hidden { display: none !important; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .mode-nav {
    position: static;
    grid-template-columns: repeat(3, 1fr);
  }
  .mode-btn { justify-content: center; text-align: center; }
  .mode-btn span:last-child { display: none; }
  .side-card { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 20px, 1180px); }
  .topbar { min-height: 72px; }
  .status-pill { font-size: 10px; padding: 0 9px; }
  .hero h1 { font-size: 45px; }
  .hero-copy > p { font-size: 15px; }
  .hero-actions > button { flex: 1 1 100%; }
  .mode-content { padding: 18px 12px; border-radius: 20px; }
  .study-card { padding: 26px 15px; }
  .panel-heading { align-items: flex-end; }
  .panel-heading h2 { font-size: 27px; }
  .counter { white-space: nowrap; }
  .settings-grid, .score-strip { grid-template-columns: 1fr; }
  .score-strip { gap: 1px; }
  footer { display: block; }
  footer p { margin-top: 8px; text-align: left; }
}


/* Voice speed selector */
.voice-speed-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 190px);
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px auto 4px;
}

.voice-speed-control label {
  color: #cbd8e8;
  font-size: 12px;
  font-weight: 800;
}

.voice-speed-control select {
  min-height: 42px;
}

@media (max-width: 520px) {
  .voice-speed-control {
    grid-template-columns: 1fr;
    width: min(100%, 320px);
    text-align: left;
  }
}


/* V0.6 child-style guided spelling lesson */
.spelling-lesson {
  display: grid;
  gap: 12px;
}

.lesson-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.lesson-step:last-of-type {
  border-bottom: 0;
}

.lesson-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(110,231,255,.12);
  border: 1px solid rgba(110,231,255,.20);
  color: #bff4ff;
  font-size: 12px;
  font-weight: 900;
}

.lesson-step small {
  display: block;
  margin-bottom: 5px;
  color: #8ea2bb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .10em;
}

.lesson-step strong {
  display: block;
  font-size: 18px;
  word-break: break-word;
}

.lesson-step p {
  margin: 7px 0 0;
  color: #d5e1ee;
  font-size: 14px;
  line-height: 1.55;
}

.mistake-step {
  background: rgba(255,255,255,.018);
  border-radius: 12px;
  padding: 12px;
}

.letter-line {
  color: #bff4ff;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.8;
  letter-spacing: .03em;
  word-break: break-word;
}

.lesson-action {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(110,231,255,.08);
  border: 1px solid rgba(110,231,255,.13);
  color: #e8f8ff;
  font-size: 13px;
  line-height: 1.5;
}


/* V0.7 — spelling mastery -> speaking mastery */
.speaking-trainer {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(110,231,255,.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(110,231,255,.07), transparent 34%),
    rgba(5,15,28,.62);
}

.speaking-head { text-align: center; }

.speaking-head h3 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: -.025em;
}

.speaking-word-box {
  max-width: 620px;
  margin: 22px auto 0;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  text-align: center;
}

.speaking-word-box > strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
}

.speaking-chunks {
  margin-top: 10px;
  color: #bff4ff;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.7;
}

.speaking-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.recording-playback {
  max-width: 620px;
  margin: 20px auto 0;
  text-align: left;
}

.recording-playback audio {
  width: 100%;
  margin-top: 8px;
}

.speech-analysis {
  max-width: 620px;
  margin: 20px auto 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  text-align: left;
}

.speech-analysis.correct {
  border-color: rgba(89,224,163,.22);
  background: rgba(89,224,163,.08);
}

.speech-analysis.wrong {
  border-color: rgba(255,142,157,.22);
  background: rgba(255,142,157,.08);
}

.speech-analysis strong,
.speech-analysis span {
  display: block;
}

.speech-analysis span {
  margin-top: 6px;
  color: #d7e3ef;
  line-height: 1.55;
}

.speech-focus {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.speech-focus small {
  display: block;
  margin-bottom: 5px;
  color: #8ea2bb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .10em;
}

.speech-focus b {
  color: #bff4ff;
  font-size: 15px;
  line-height: 1.7;
}


/* V0.8 — three child-style spelling guides */
.child-guides {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.child-guide-card {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
}

.guide-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(110,231,255,.10);
  border: 1px solid rgba(110,231,255,.18);
  color: #bff4ff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .10em;
}

.child-guide-card h4 {
  margin: 10px 0 8px;
  font-size: 17px;
}

.child-guide-card p {
  margin: 9px 0 0;
  color: #b8c8d8;
  font-size: 13px;
  line-height: 1.55;
}

.guide-big {
  padding: 12px;
  border-radius: 12px;
  background: rgba(110,231,255,.06);
  color: #dffbff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1.6;
}

.build-steps {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.build-steps span {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: #e4eef8;
  font-size: 14px;
  font-weight: 750;
}

.build-steps b {
  display: inline-block;
  min-width: 24px;
  color: #8fe8ff;
}

.guide-memory-word {
  margin: 10px 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
}

.guide-memory-word.covered {
  color: #88a0b8;
  letter-spacing: .18em;
}

.child-guide-card button {
  margin-top: 12px;
}


/* V0.9 — explicit foundation stages and persistent baby spelling guide */
.foundation-stage-bar {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.foundation-line {
  height: 2px;
  background: rgba(255,255,255,.08);
}

.foundation-stage {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  opacity: .58;
}

.foundation-stage.active {
  opacity: 1;
  border-color: rgba(110,231,255,.22);
  background: rgba(110,231,255,.07);
}

.foundation-stage > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: rgba(110,231,255,.12);
  color: #bff4ff;
  font-weight: 900;
}

.foundation-stage strong,
.foundation-stage small {
  display: block;
}

.foundation-stage strong {
  font-size: 13px;
}

.foundation-stage small {
  margin-top: 2px;
  color: #8ea2bb;
  font-size: 10px;
}

.baby-guide-title {
  margin: 16px 0 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(110,231,255,.055);
  border: 1px solid rgba(110,231,255,.12);
}

.baby-guide-title span,
.baby-guide-title strong,
.baby-guide-title p {
  display: block;
}

.baby-guide-title span {
  color: #7fe9ff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .10em;
}

.baby-guide-title strong {
  margin-top: 5px;
  font-size: 19px;
}

.baby-guide-title p {
  margin: 6px 0 0;
  color: #aabccd;
  font-size: 12px;
  line-height: 1.55;
}

.mistake-guide {
  border-color: rgba(255,142,157,.16);
  background: rgba(255,142,157,.045);
}

.spelling-review-btn {
  margin-top: 14px;
}

.speaking-spelling-review {
  max-width: 720px;
  margin: 18px auto 0;
  padding: 16px;
  border: 1px solid rgba(110,231,255,.14);
  border-radius: 17px;
  background: rgba(255,255,255,.025);
  text-align: left;
}

.compact-guides .child-guide-card {
  padding: 14px;
}

@media (max-width: 620px) {
  .foundation-stage-bar {
    grid-template-columns: 1fr;
  }

  .foundation-line {
    width: 2px;
    height: 22px;
    margin: 0 auto;
  }
}


/* V1.0 — separate spelling school below Review */
.foundation-intro-card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(110,231,255,.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(110,231,255,.06), rgba(139,124,255,.04));
}

.foundation-intro-card h3 {
  margin: 7px 0 8px;
  font-size: 22px;
}

.foundation-intro-card p {
  max-width: 760px;
  margin: 0;
  color: #aebed0;
  line-height: 1.65;
  font-size: 13px;
}

.foundation-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.foundation-levels {
  display: grid;
  align-content: start;
  gap: 8px;
}

.foundation-level-btn {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  text-align: left;
  cursor: pointer;
}

.foundation-level-btn:hover {
  border-color: rgba(110,231,255,.18);
  background: rgba(110,231,255,.04);
}

.foundation-level-btn > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: #b9c9da;
  font-size: 12px;
  font-weight: 900;
}

.foundation-level-btn.completed > span {
  background: rgba(89,224,163,.10);
  color: #8ff1c5;
}

.foundation-level-btn strong,
.foundation-level-btn small {
  display: block;
}

.foundation-level-btn strong {
  font-size: 12px;
}

.foundation-level-btn small {
  margin-top: 3px;
  color: #8da0b7;
  font-size: 10px;
  line-height: 1.35;
}

.foundation-lesson {
  min-height: 520px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: rgba(7,17,31,.46);
}

.foundation-empty {
  color: #8ea0b6;
  text-align: center;
  padding: 80px 20px;
}

.foundation-lesson-head h3 {
  margin: 9px 0 5px;
  font-size: 28px;
}

.foundation-lesson-head p {
  margin: 0;
  color: #94a6bb;
}

.foundation-rule,
.foundation-teach-box,
.foundation-mini {
  margin-top: 18px;
  padding: 16px;
  border-radius: 15px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}

.foundation-rule small,
.foundation-teach-box small,
.foundation-mini small {
  display: block;
  margin-bottom: 7px;
  color: #7fe9ff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .10em;
}

.foundation-rule strong {
  display: block;
  line-height: 1.6;
  font-size: 14px;
}

.foundation-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.foundation-example {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  text-align: left;
  cursor: pointer;
}

.foundation-example:hover {
  border-color: rgba(110,231,255,.18);
}

.foundation-example strong,
.foundation-example span,
.foundation-example small {
  display: block;
}

.foundation-example strong {
  font-size: 16px;
}

.foundation-example span {
  margin-top: 4px;
  color: #9eb0c4;
  font-size: 11px;
}

.foundation-example small {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #6fdfff;
  font-size: 9px;
}

.foundation-teach-box ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.foundation-teach-box li {
  margin: 8px 0;
  color: #c8d5e3;
  line-height: 1.55;
  font-size: 13px;
}

.foundation-mini p {
  margin: 0;
  color: #dce8f4;
  line-height: 1.6;
}

.foundation-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 780px) {
  .foundation-layout {
    grid-template-columns: 1fr;
  }

  .foundation-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foundation-example-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .foundation-levels {
    grid-template-columns: 1fr;
  }
}


/* V1.1 — Spelling School automatic audio teacher */
.foundation-audio-toolbar {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(110,231,255,.14);
  border-radius: 18px;
  background: rgba(110,231,255,.035);
}

.foundation-audio-toolbar > div:first-child > strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.foundation-audio-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.foundation-audio-controls label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: #c9d7e5;
  font-size: 11px;
  font-weight: 850;
}

.foundation-audio-controls select {
  min-height: 48px;
}

.foundation-audio-status {
  margin: 12px 0 0;
  color: #91a6bd;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .foundation-audio-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .foundation-audio-controls button,
  .foundation-audio-controls label {
    width: 100%;
  }
}


/* =========================================================
   AmitTools PTE Trainer — Build 12
   Personal weakness tracking + Write From Dictation V1
   ========================================================= */

.task-mode-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(110,231,255,.12);
  border-radius: 14px;
  background: rgba(110,231,255,.04);
}

.task-mode-note strong {
  color: #8deaff;
  white-space: nowrap;
}

.task-mode-note span {
  color: #aebed0;
  font-size: 12px;
  line-height: 1.5;
}

.dictation-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 112px;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  color: inherit;
  font: inherit;
  line-height: 1.6;
}

.dictation-card textarea:focus {
  outline: none;
  border-color: rgba(110,231,255,.34);
  box-shadow: 0 0 0 3px rgba(110,231,255,.05);
}

.dictation-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.dictation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 18px;
}

.dictation-stats > div {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.dictation-stats span,
.dictation-stats strong {
  display: block;
}

.dictation-stats span {
  color: #8fa2b8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dictation-stats strong {
  margin-top: 5px;
  font-size: 18px;
}

.dictation-result {
  text-align: left;
}

.dictation-score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.dictation-score-line span {
  color: #aab9c9;
  font-size: 11px;
}

.dictation-answer-block {
  margin-top: 11px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.dictation-answer-block.correct-answer {
  background: rgba(89,224,163,.05);
}

.dictation-answer-block small,
.dictation-answer-block p {
  display: block;
}

.dictation-answer-block small {
  color: #8fa2b8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.dictation-answer-block p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.dictation-diagnosis {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dictation-diagnosis > div {
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255,255,255,.03);
}

.dictation-diagnosis small,
.dictation-diagnosis strong {
  display: block;
}

.dictation-diagnosis small {
  color: #ffbdc6;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .07em;
}

.dictation-diagnosis strong {
  margin-top: 4px;
  line-height: 1.5;
  font-size: 13px;
}

.dictation-result-actions {
  margin-top: 14px;
}

.weakness-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(7,17,31,.42);
}

.compact-heading {
  margin-bottom: 12px;
}

.compact-heading h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.mini-btn {
  min-height: 36px;
  padding: 8px 12px;
}

.weakness-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.weakness-column {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.weakness-column > small {
  color: #7fe9ff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
}

.weakness-column ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.weakness-column li {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.weakness-column li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.weakness-column strong,
.weakness-column span {
  display: block;
}

.weakness-column strong {
  font-size: 13px;
}

.weakness-column span {
  margin-top: 3px;
  color: #91a5ba;
  font-size: 10px;
  line-height: 1.45;
}

.weakness-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  color: #91a5ba;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 780px) {
  .weakness-summary {
    grid-template-columns: 1fr;
  }

  .dictation-stats {
    grid-template-columns: 1fr;
  }

  .dictation-score-line {
    display: grid;
  }
}
