:root {
  font-family: Inter, system-ui, sans-serif;
  color: #102a43;
  background: #f5f8fc;
  --navy: #10243e;
  --blue: #2864d7;
  --muted: #718096;
  --line: #dfe7f1;
  --card: #fff;
  --shadow: 0 18px 55px #15305314;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 0, #eaf2ff, transparent 34rem), #f5f8fc;
  color: #102a43;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #a8c7ff;
  outline-offset: 2px;
}
.app-shell {
  max-width: 1080px;
  margin: auto;
  padding: 24px 30px 56px;
}
.site-header,
.header-actions,
.brand,
.practice-header,
.session-progress > div:first-child,
.section-title,
.page-heading,
.answer-row,
.summary-actions {
  display: flex;
  align-items: center;
}
.site-header {
  justify-content: space-between;
  margin-bottom: 58px;
}
.brand {
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 23px;
}
.brand b,
.brand small {
  display: block;
}
.brand b {
  font-size: 18px;
}
.brand small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.header-actions {
  gap: 9px;
}
.button {
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 700;
}
.button-quiet,
.button-icon,
.button-secondary,
.button-danger {
  background: #fff;
  border: 1px solid var(--line);
  color: #45617e;
}
.button-icon {
  font-size: 20px;
  padding: 8px 12px;
  line-height: 1;
}
.intro {
  max-width: 760px;
  margin-bottom: 48px;
}
.eyebrow {
  color: #4e7ed2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
  margin: 0 0 15px;
}
.intro h1,
.summary-view h1,
.page-heading h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -2px;
  margin: 0 0 20px;
  color: var(--navy);
}
h1 em {
  color: #477ce0;
  font-style: normal;
}
.intro-copy {
  max-width: 620px;
  color: #60748c;
  line-height: 1.7;
  margin: 0;
}
.headline-stats {
  display: flex;
  gap: 38px;
  margin-top: 30px;
}
.headline-stats span,
.score-card span {
  display: flex;
  flex-direction: column;
}
.headline-stats b {
  font-size: 24px;
  color: var(--navy);
}
small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.section-title {
  justify-content: space-between;
  margin-bottom: 15px;
}
.section-title h2,
.word-bank h2 {
  font-size: 21px;
  color: var(--navy);
  margin: 0;
}
.section-title > span {
  color: var(--muted);
  font-size: 12px;
}
.badge,
.prompt-tag {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 800;
  color: #5e82bc;
  background: #eaf1ff;
  border-radius: 20px;
  padding: 7px 11px;
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  min-height: 116px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 25px #2041690a;
  transition: 0.2s;
}
.mode-card:hover {
  transform: translateY(-3px);
  border-color: #b7cdf3;
}
.mode-card > span:nth-child(2) {
  flex: 1;
}
.mode-card b,
.mode-card small {
  display: block;
}
.mode-card b {
  font-size: 14px;
  color: var(--navy);
}
.mode-card small {
  line-height: 1.45;
}
.mode-card i {
  font-size: 22px;
  color: #8ba9d7;
  font-style: normal;
}
.mode-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 11px;
  font-weight: 800;
}
.blue {
  background: #e8f0ff;
  color: #3974dc;
}
.orange {
  background: #fff1e7;
  color: #d77a35;
  font-size: 11px;
}
.green {
  background: #e5f7ef;
  color: #279269;
}
.purple {
  background: #f0eaff;
  color: #8057c8;
  font-size: 11px;
}
.word-bank {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.word-bank p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}
.word-list {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 66%;
}
.word-chip {
  position: relative;
  background: #f5f8fc;
  border: 1px solid #e1eaf5;
  border-radius: 8px;
  padding: 8px 10px;
  color: #3d608b;
  font-size: 12px;
  font-weight: 700;
}
.word-chip > span {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 5px);
  opacity: 0;
  pointer-events: none;
  width: max-content;
  max-width: 190px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  transition: 0.15s;
}
.word-chip:hover > span,
.word-chip:focus > span {
  opacity: 1;
  transform: translate(-50%, 0);
}
.view {
  display: none;
}
.view.is-active {
  display: block;
}
.practice-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 0;
  background: #f5f8fc;
  gap: 20px;
  margin-bottom: 28px;
}
.lesson-picker {
  display: grid;
  gap: 8px;
  max-width: 480px;
  margin-bottom: 28px;
}
.lesson-picker label {
  font-weight: 700;
}
.lesson-picker select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  color: var(--navy);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.lesson-picker small {
  color: var(--muted);
}
.back-link {
  padding: 8px 0;
  background: transparent;
  color: #58708c;
  font-weight: 700;
}
.session-progress {
  flex: 1;
  max-width: 560px;
  margin: auto;
}
.session-progress > div:first-child {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}
.progress-track {
  height: 6px;
  background: #e1e9f3;
  border-radius: 8px;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 8px;
}
.prompt-card,
.answer-form,
.feedback {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.prompt-card {
  padding: 34px 38px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.prompt-card p {
  font-size: clamp(23px, 4vw, 34px);
  line-height: 1.3;
  color: var(--navy);
  margin: 19px 0;
}
.prompt-card strong {
  color: var(--blue);
}
.blank {
  display: inline-block;
  min-width: 90px;
  border-bottom: 3px solid #5b89df;
  color: #5b89df;
}
.answer-form label {
  display: block;
  color: #4b6380;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.answer-row {
  gap: 10px;
}
.answer-row input {
  width: 100%;
}
input {
  border: 1px solid #cfdaea;
  border-radius: 11px;
  background: #fff;
  color: var(--navy);
  padding: 14px 15px;
  font-size: 16px;
}
.button-primary,
.button-next {
  background: var(--blue);
  color: #fff;
}
.button-primary:hover,
.button-next:hover {
  background: #1d52bc;
}
.feedback {
  margin-top: 16px;
  padding: 15px 17px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}
.feedback strong,
.feedback span,
.feedback small {
  display: block;
}
.feedback.good {
  background: #e8f7ef;
  color: #22724d;
  border: 1px solid #c7ecd8;
}
.feedback.bad {
  background: #fff0ee;
  color: #a3453e;
  border: 1px solid #f4d2ce;
}
.feedback-ai {
  background: #eef5ff;
  color: #24538f;
  border: 1px solid #d6e6ff;
}
.feedback-ai.loading {
  background: #fff8e5;
  color: #8b6500;
  border-color: #f1dfaa;
}
.feedback-ai.offline {
  background: #f3f4f6;
  color: #5b6470;
  border-color: #e2e5e9;
}
.ai-example {
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid #4b82df;
  background: #fff;
  color: #17395f;
  border-radius: 7px;
}
.ai-example small {
  font-weight: 800;
  color: #4773ad;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-example span {
  margin-top: 4px;
  font-style: italic;
}
.button-next {
  font-size: 15px;
  flex-shrink: 0;
  white-space: nowrap;
}
.dark .practice-header {
  background: #0d1726;
}
.summary-view {
  text-align: center;
}
.summary-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e8f0ff;
  color: #3974dc;
  font-size: 27px;
  margin: 50px auto 22px;
}
.summary-view h1 {
  font-size: 42px;
}
.summary-view > p:not(.eyebrow) {
  color: var(--muted);
}
.score-card {
  display: flex;
  justify-content: center;
  max-width: 650px;
  margin: 34px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.score-card span {
  flex: 1;
  text-align: center;
  padding: 20px;
}
.score-card b {
  font-size: 26px;
  color: var(--navy);
}
.summary-actions {
  justify-content: center;
  gap: 10px;
}
.page-heading {
  justify-content: space-between;
  margin-bottom: 30px;
}
.page-heading h1 {
  font-size: 36px;
  margin: 3px 0 0;
}
.progress-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 35px;
}
.progress-cards > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
}
.progress-cards b {
  display: block;
  font-size: 27px;
  color: var(--navy);
}
.word-analysis {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
}
.analysis-row {
  display: grid;
  width: 100%;
  min-width: 0;
  text-align: left;
  grid-template-columns: 180px 1fr 80px;
  align-items: center;
  gap: 20px;
  padding: 15px 18px;
  border-bottom: 1px solid #edf1f6;
}
.analysis-row:last-child {
  border: 0;
}
.analysis-row b,
.analysis-row small {
  display: block;
}
.meter {
  height: 8px;
  background: #e9eef5;
  border-radius: 9px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--mastery-color, #4b82df);
}
.analysis-row > div:first-child {
  border-left: 3px solid var(--mastery-color, #9aa8b8);
  padding-left: 9px;
}
.analysis-row > strong {
  text-align: right;
  color: #315f9e;
}
.dark {
  --card: #17263b;
  --navy: #f3f7fd;
  --muted: #9eafc5;
  --line: #2b405b;
  color: #edf4ff;
  background: #101c2b;
}
.dark .prompt-card,
.dark .word-bank,
.dark .mode-card,
.dark .score-card,
.dark .progress-cards > div,
.dark .word-analysis,
.dark input,
.dark .button-quiet,
.dark .button-icon,
.dark .button-secondary {
  background: #17263b;
}
@media (max-width: 700px) {
  .app-shell {
    padding: 18px 16px 40px;
  }
  .site-header {
    margin-bottom: 38px;
  }
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .word-bank {
    display: block;
  }
  .word-list {
    max-width: none;
    justify-content: flex-start;
    margin-top: 18px;
  }
  .practice-header {
    gap: 10px;
  }
  .back-link span {
    display: none;
  }
  .prompt-card {
    padding: 25px 20px;
  }
  .answer-row {
    align-items: stretch;
    flex-direction: column;
  }
  .answer-row .button {
    width: 100%;
  }
  .progress-cards {
    gap: 8px;
  }
  .progress-cards > div {
    padding: 14px 10px;
  }
  .progress-cards b {
    font-size: 21px;
  }
  .analysis-row {
    grid-template-columns: 1fr 65px;
    gap: 9px;
  }
  .analysis-row .meter {
    grid-column: 1;
  }
  .analysis-row > strong {
    grid-column: 2;
    grid-row: 1/3;
  }
  .summary-actions {
    flex-direction: column;
  }
  .summary-actions .button {
    width: 100%;
  }
}
.voice-tools { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.voice-tools p { width: 100%; margin: 0; font-size: 13px; line-height: 1.5; opacity: .85; }
.voice-tools audio { max-width: 100%; height: 40px; }
.is-recording { background: #b53045 !important; color: white !important; }
