:root {
  --paper: #f7f7f0;
  --ink: #203e4b;
  --muted: #66777b;
  --navy: #173e52;
  --teal: #267d72;
  --blue: #e4eff8;
  --mint: #e5f0e6;
  --yellow: #f8efcf;
  --line: #dfe4dc;
  --white: #fff;
  --radius: 22px;
  --font: ui-rounded, "Avenir Next", "Nunito", "Trebuchet MS", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(ellipse at 50% 0%, #fffdf8 0, transparent 65%);
  min-height: 100svh;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button,
a {
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.42;
}
button {
  border: 0;
}
a {
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #3887b1;
  outline-offset: 5px;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.15;
}
main:focus {
  outline: none;
}
.app-shell {
  width: min(1040px, 100%);
  margin: auto;
  padding: 0 40px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 112px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1.1px;
}
.brand-symbol {
  font-family: Georgia, serif;
  font-size: 38px;
  color: var(--teal);
  line-height: 1;
}
.brand-period {
  color: var(--teal);
}
nav {
  display: flex;
  align-items: center;
  gap: 29px;
}
.nav-progress {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  min-height: 48px;
}
.nav-progress svg {
  height: 21px;
  width: 21px;
}
.icon-button {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 0.2s;
}
.icon-button:hover {
  background: #e8ede5;
}
#app {
  flex: 1;
}
.screen {
  animation: arrive 0.3s ease both;
}
.home-intro {
  padding: 47px 0 32px;
  text-align: center;
}
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.1px;
  line-height: 1.5;
}
.little-spark {
  color: var(--teal);
  margin-right: 6px;
  font-size: 14px;
}
.home-intro h1 {
  font-size: clamp(48px, 6vw, 65px);
  font-weight: 800;
  letter-spacing: -3.8px;
  position: relative;
  display: inline-block;
  margin: 9px 0 10px;
}
.title-spark {
  position: absolute;
  right: -38px;
  top: -3px;
  font-size: 29px;
  font-weight: 400;
  color: #cca442;
  transform: rotate(12deg);
}
.home-intro p {
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 0.1px;
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.mode-card {
  border-radius: var(--radius);
  text-align: left;
  min-width: 0;
  padding: 24px 22px 19px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  background: var(--blue);
  min-height: 267px;
  box-shadow: 0 3px 0 #203e4b05;
}
.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 9px 18px #203e4b0a;
}
.mode-card:active {
  transform: translateY(-1px) scale(0.985);
}
.mode-card.daily {
  background: var(--navy);
  color: #fff;
}
.mode-card.divide {
  background: var(--mint);
}
.mode-card.tough {
  background: var(--yellow);
}
.mode-top {
  height: 67px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.mode-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.7;
}
.daily .mode-icon {
  color: #f4d487;
}
.mode-tag {
  font-size: 8px;
  letter-spacing: 1.2px;
  font-weight: 700;
  line-height: 1.6;
  padding-top: 4px;
  max-width: 74px;
  color: #ccdce0;
  margin-left: auto;
}
.math-icon {
  font-family: var(--font);
  font-size: 57px;
  font-weight: 500;
  line-height: 0.7;
  display: block;
  padding-top: 3px;
  color: #49788e;
}
.divide .math-icon {
  color: #52816c;
}
.tough .mode-icon {
  color: #9b7a2e;
}
.mode-title {
  font-size: 25px;
  letter-spacing: -1px;
  font-weight: 750;
  white-space: nowrap;
}
.mode-title strong {
  font-weight: 500;
}
.mode-description {
  font-size: 12px;
  line-height: 1.75;
  display: block;
  margin-top: 8px;
  max-width: 175px;
  color: #4f6872;
}
.daily .mode-description {
  color: #d4e1e7;
}
.mode-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: auto;
  padding-top: 27px;
  font-size: 10px;
  font-weight: 700;
}
.mode-arrow {
  width: 29px;
  height: 29px;
  border: 1px solid #203e4b24;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.mode-arrow svg {
  width: 16px;
  height: 16px;
}
.daily .mode-arrow {
  border-color: #ffffff38;
}
.family-link {
  background: none;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 22px auto 30px;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
}
.family-link strong {
  font-weight: 600;
  color: var(--ink);
}
.family-link > span:last-child {
  margin-left: 6px;
  color: var(--ink);
  font-size: 20px;
}
.family-icon {
  display: grid;
  place-items: center;
  color: var(--teal);
}
.family-icon svg {
  width: 21px;
  height: 21px;
}
.family-link:hover {
  color: var(--teal);
}
.home-progress {
  border-top: 1px solid var(--line);
  padding-top: 23px;
}
.progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.progress-heading h2 {
  font-size: 15px;
  letter-spacing: -0.2px;
}
.progress-heading a {
  font-size: 11px;
  color: var(--muted);
}
.progress-heading a span {
  margin-left: 6px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.stats-row > div {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding-left: 8px;
}
.stats-row > div:first-child {
  padding-left: 0;
}
.stats-row > div:last-child {
  border: 0;
}
.stats-row strong {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
}
.stat-decoration {
  font-size: 15px;
  letter-spacing: 0;
  color: #71827d;
  margin-left: 4px;
}
.stats-row > div > span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.mastery-track {
  height: 5px;
  background: #e6eae0;
  border-radius: 5px;
  margin-top: 26px;
  overflow: hidden;
}
.mastery-track > span {
  display: block;
  height: 100%;
  background: #76a58b;
  border-radius: inherit;
  min-width: 4px;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 37px 0 25px;
  color: #76827f;
  font-size: 10px;
}
.tiny-star {
  color: #a78b44;
  margin-right: 6px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  background: none;
}
.back-link:hover {
  color: var(--teal);
}
.page-heading {
  margin: 22px 0 35px;
}
.page-heading h1 {
  font-size: 46px;
  letter-spacing: -2px;
  margin: 9px 0 12px;
}
.page-heading p {
  color: var(--muted);
  font-size: 16px;
}
.heading-dot {
  color: var(--teal);
}
.setup-screen,
.settings-screen,
.progress-screen {
  padding-top: 24px;
  max-width: 740px;
  margin: auto;
}
.setup-screen {
  max-width: 660px;
}
.setup-panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 7px 30px #173e5203;
}
fieldset {
  border: 0;
  margin: 0 0 28px;
  padding: 0;
}
legend {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 15px;
}
.presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 17px;
}
.preset {
  background: none;
  border-radius: 8px;
  color: var(--muted);
  min-height: 44px;
  padding: 8px 13px;
  font-size: 13px;
}
.preset:hover,
.preset.active {
  background: #e7eee6;
  color: var(--ink);
}
.table-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
}
.table-chip {
  height: 54px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  background: #eef1ec;
  border: 1px solid transparent;
  transition:
    background 0.2s,
    transform 0.15s;
}
.table-chip.selected {
  background: var(--navy);
  color: #fff;
}
.table-chip:active {
  transform: scale(0.94);
}
.table-chip:disabled {
  background: transparent;
  color: #7b868b;
  text-decoration: line-through;
}
.field-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 13px;
}
.length-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.length-option {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 12px;
  color: var(--muted);
}
.length-option strong {
  font-size: 22px;
  color: var(--ink);
  margin-right: 5px;
}
.length-option.selected {
  background: #e5eee6;
  border-color: #7e9b86;
  color: var(--ink);
}
.button {
  min-height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  transition:
    background 0.18s,
    transform 0.18s;
  border: 1px solid transparent;
}
.button:hover {
  transform: translateY(-2px);
}
.button.primary {
  background: var(--navy);
  color: white;
}
.button.primary:hover {
  background: #24536a;
}
.button.secondary {
  border-color: #cfd8cf;
  background: transparent;
}
.button.danger {
  background: #9e4236;
  color: #fff;
}
.start-button {
  width: 100%;
}
.start-button svg {
  width: 20px;
}
.quiet-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
.setup-message {
  color: #8a5b23;
  font-size: 13px;
  margin: 0 0 12px;
}
.practice-screen {
  padding-top: 32px;
}
.practice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.practice-top .eyebrow {
  color: var(--teal);
  letter-spacing: 1.7px;
}
.question-count {
  font-size: 13px;
  color: var(--muted);
}
.question-count strong {
  color: var(--ink);
}
.session-track {
  height: 5px;
  border-radius: 5px;
  background: #e2e8df;
  margin-top: 18px;
  overflow: hidden;
}
.session-track span {
  display: block;
  background: #579581;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s;
}
.practice-workspace {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: 800px;
  margin: 50px auto 30px;
}
.problem-side {
  text-align: center;
  position: relative;
}
.problem-eyebrow {
  font-size: 9px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--muted);
}
.equation {
  font-size: clamp(64px, 7vw, 90px);
  font-weight: 650;
  letter-spacing: -4px;
  display: flex;
  justify-content: center;
  gap: 22px;
  align-items: center;
  margin: 26px 0;
}
.equation > span {
  font-size: 0.7em;
  color: #78918f;
  font-weight: 400;
}
.answer {
  display: block;
  width: 185px;
  height: 98px;
  margin: auto;
  border: 2px solid #a9bbb5;
  border-radius: 17px;
  background: #fffef9;
  color: var(--ink);
  font-size: 52px;
  font-weight: 650;
  text-align: center;
  outline-offset: 4px;
  caret-color: var(--teal);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.answer::placeholder {
  color: #bcc8c1;
  font-weight: 400;
}
.answer.correct {
  background: #e0eee0;
  border-color: #75a185;
  color: #347058;
  animation: answer-win 0.35s ease;
}
.feedback {
  min-height: 63px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  padding: 13px 0;
}
.feedback.success {
  color: #326a50;
  font-weight: 700;
  font-size: 17px;
}
.feedback.retry {
  color: #875d27;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}
.key {
  height: 68px;
  min-width: 0;
  border-radius: 14px;
  background: #fffefb;
  box-shadow: 0 3px 0 #dce2d9;
  border: 1px solid #e2e6de;
  font-size: 27px;
  font-weight: 550;
  transition:
    background 0.12s,
    transform 0.12s;
}
.key:hover {
  background: #edf2e9;
}
.key:active {
  transform: translateY(3px);
  box-shadow: none;
}
.key-submit {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 3px 0 #102f3e;
}
.key-submit:hover {
  background: #285569;
}
.key-back {
  background: #e9eee6;
  border-color: transparent;
  box-shadow: none;
  font-size: 24px;
}
.keyboard-note {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  margin-top: 22px;
}
kbd {
  font: inherit;
  padding: 3px 6px;
  border: 1px solid #d7dfd5;
  border-radius: 4px;
  margin-left: 5px;
  background: #fffdf8;
}
.review-note {
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  margin: 32px 0;
}
.hint {
  background: #edf1e5;
  border-radius: 18px;
  padding: 20px;
  margin-top: 0;
  text-align: left;
  animation: arrive 0.25s ease;
}
.hint h2 {
  font-size: 16px;
  margin: 12px 0 9px;
}
.hint p {
  font-size: 14px;
  margin: 4px 0;
}
.hint .button {
  margin-top: 14px;
  width: 100%;
}
.hint-answer {
  font-size: 21px;
  border-bottom: 1px solid #d1dccb;
  padding-bottom: 9px;
}
.hint-visible {
  opacity: 0.4;
}
.empty-screen {
  text-align: center;
  max-width: 550px;
  margin: auto;
  padding: 25px 0 80px;
}
.empty-screen > .back-link {
  display: flex;
  justify-content: flex-start;
}
.empty-symbol {
  margin: 65px auto 25px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--yellow);
  display: grid;
  place-items: center;
  color: #967833;
}
.empty-symbol svg {
  width: 50px;
  height: 50px;
}
.empty-screen h1 {
  font-size: 35px;
  letter-spacing: -1px;
}
.empty-screen p {
  color: var(--muted);
  margin: 20px auto 30px;
  max-width: 380px;
}
.complete-screen {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 0 15px;
}
.completion-mark {
  position: relative;
  margin: 0 auto 25px;
  width: 68px;
  height: 68px;
  background: #e1eddd;
  border-radius: 50%;
  font-size: 36px;
  color: #4b8062;
  display: grid;
  place-items: center;
  animation: answer-win 0.5s ease;
}
.completion-mark span {
  position: absolute;
  right: -17px;
  top: -9px;
  color: #b29442;
  font-size: 27px;
}
.complete-screen h1 {
  font-size: 49px;
  letter-spacing: -2px;
  margin: 11px 0 15px;
}
.complete-screen > p {
  color: var(--muted);
}
.result-score {
  margin: 27px 0 22px;
}
.result-score > strong {
  font-size: 62px;
  font-weight: 650;
  letter-spacing: -3px;
}
.result-score > span {
  font-size: 28px;
  color: #8a9791;
}
.result-score p {
  font-size: 13px;
  color: var(--muted);
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 23px 0;
  border-block: 1px solid var(--line);
}
.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}
.result-stats > div:last-child {
  border: 0;
}
.result-stats strong {
  font-size: 27px;
  font-weight: 600;
}
.result-stats span {
  color: var(--muted);
  font-size: 12px;
}
.missed-facts {
  margin: 24px 0;
}
.missed-facts h2 {
  font-size: 14px;
  margin-bottom: 12px;
}
.missed-facts p {
  font-size: 16px;
  line-height: 2;
}
.missed-facts p span {
  margin: 0 12px;
  color: #92a39b;
}
.completion-note {
  margin: 25px 0;
}
.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.completion-actions > .back-link {
  width: 100%;
  justify-content: center;
  margin-top: 5px;
}
.progress-totals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-block: 1px solid var(--line);
  padding: 24px 0;
  gap: 17px;
}
.progress-totals > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.progress-totals strong {
  font-size: 28px;
  font-weight: 600;
}
.progress-totals span {
  font-size: 11px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 35px 0 16px;
}
.section-heading h2 {
  font-size: 18px;
}
.section-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.table-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
}
.table-progress-row {
  display: flex;
  gap: 15px;
  align-items: center;
  background: none;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-size: 12px;
}
.table-progress-row:hover {
  background: #edf1e8;
}
.table-progress-row strong {
  font-size: 16px;
  width: 28px;
  text-align: left;
}
.table-progress-row > span:nth-last-child(2) {
  width: 32px;
  text-align: right;
  color: var(--muted);
}
.table-bar {
  height: 7px;
  flex: 1;
  border-radius: 5px;
  background: #e1e7dc;
  overflow: hidden;
}
.table-bar > span {
  display: block;
  height: 100%;
  background: #689e83;
  border-radius: inherit;
}
.achievements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 24px;
  margin: 27px 0;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #67756d;
}
.achievement-symbol {
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px dashed #a2afa0;
  background: #eef0e9;
  display: grid;
  place-items: center;
  font-size: 21px;
}
.achievement.earned .achievement-symbol {
  background: var(--yellow);
  color: #826422;
  border-style: solid;
  border-color: #e1d59f;
}
.achievement h3 {
  font-size: 13px;
  margin-bottom: 5px;
}
.achievement p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.achievement.earned h3 {
  color: var(--ink);
}
.fact-list {
  margin: 0 0 28px;
}
.fact-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  min-height: 58px;
}
.fact-row > strong {
  font-size: 20px;
  width: 110px;
}
.fact-row > span:last-child {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.fact-dots {
  display: flex;
  gap: 6px;
}
.fact-dots i {
  height: 9px;
  width: 9px;
  border-radius: 50%;
  background: #dfe5db;
}
.fact-dots .filled {
  background: #699c81;
}
.settings-list {
  border-top: 1px solid var(--line);
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row strong {
  font-size: 16px;
  font-weight: 650;
  display: block;
}
.setting-row small {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.setting-row select {
  max-width: 205px;
  min-height: 48px;
  border: 1px solid #d5ded2;
  border-radius: 10px;
  background: #fffef8;
  color: var(--ink);
  padding: 10px;
  font-size: 13px;
}
.setting-row input[role="switch"] {
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 20px;
  background: #d2d9cd;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 0 0 9px transparent;
}
.setting-row input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #0002;
  transition: transform 0.2s;
}
.setting-row input:checked {
  background: var(--teal);
}
.setting-row input:checked::after {
  transform: translateX(20px);
}
.reset-row {
  margin-top: 25px;
}
.reset-row .button {
  font-size: 12px;
  white-space: nowrap;
}
.settings-saved {
  font-size: 12px;
  color: var(--muted);
  margin-top: 24px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 30px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 80px #173e5233;
}
dialog::backdrop {
  background: #14344655;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 27px;
  letter-spacing: -1px;
  margin: 12px 0 16px;
}
dialog p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.button-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.button-row .button {
  font-size: 12px;
  padding-inline: 14px;
}
.milestone-spark {
  position: absolute;
  top: 65px;
  left: 50%;
  font-size: 26px;
  color: #bb9538;
  white-space: nowrap;
  pointer-events: none;
  animation: spark 0.9s ease forwards;
}
.resume-button {
  display: block;
  margin: 18px auto 0;
  background: none;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
  min-height: 44px;
}
.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;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes answer-win {
  50% {
    transform: scale(1.04);
  }
}
@keyframes spark {
  from {
    opacity: 0;
    transform: translate(-50%, 15px) scale(0.8);
  }
  40% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(-50%, -40px) scale(1.15);
  }
}
@media (min-width: 1200px) {
  .app-shell {
    padding-inline: 30px;
  }
  .home-intro {
    padding-top: 53px;
    padding-bottom: 38px;
  }
  .mode-card {
    min-height: 277px;
    padding: 26px 23px 20px;
  }
  .mode-title {
    font-size: 27px;
  }
  .mode-description {
    font-size: 13px;
  }
  .mode-bottom {
    font-size: 11px;
  }
  .family-link {
    margin-bottom: 34px;
  }
  .home-progress {
    padding-top: 25px;
  }
  .app-footer {
    padding-top: 39px;
  }
}
@media (min-width: 701px) and (max-width: 950px) {
  .app-shell {
    max-width: 780px;
  }
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 17px;
  }
  .mode-card {
    min-height: 205px;
    padding: 22px 25px;
  }
  .mode-top {
    height: 51px;
  }
  .mode-title {
    font-size: 27px;
  }
  .mode-description {
    max-width: none;
    font-size: 13px;
  }
  .mode-bottom {
    padding-top: 16px;
    font-size: 11px;
  }
  .mode-tag {
    max-width: none;
  }
  .home-intro {
    padding-top: 34px;
    padding-bottom: 30px;
  }
  .practice-workspace {
    gap: 35px;
    margin-top: 65px;
  }
  .equation {
    font-size: 72px;
    gap: 15px;
  }
  .key {
    height: 72px;
  }
  .stats-row {
    gap: 16px;
  }
  .stats-row > div > span {
    font-size: 10px;
  }
}
@media (max-width: 700px) {
  .app-shell {
    padding: 0 22px;
  }
  .app-header {
    height: 85px;
  }
  .brand {
    font-size: 23px;
    gap: 7px;
  }
  .brand-symbol {
    font-size: 33px;
  }
  nav {
    gap: 17px;
  }
  .nav-progress {
    font-size: 12px;
    gap: 6px;
  }
  .nav-progress svg {
    width: 18px;
  }
  .icon-button {
    width: 40px;
    height: 40px;
  }
  .icon-button svg {
    width: 20px;
  }
  .home-intro {
    padding: 32px 0 28px;
  }
  .home-intro .eyebrow {
    font-size: 8px;
    letter-spacing: 1.8px;
  }
  .home-intro h1 {
    font-size: 51px;
    letter-spacing: -3px;
    margin-top: 10px;
  }
  .title-spark {
    font-size: 23px;
    right: -28px;
    top: -1px;
  }
  .home-intro p {
    font-size: 15px;
  }
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .mode-card {
    padding: 20px 17px 17px;
    border-radius: 18px;
    min-height: 220px;
  }
  .mode-top {
    height: 55px;
  }
  .mode-icon svg {
    width: 34px;
    height: 34px;
  }
  .mode-tag {
    font-size: 7px;
    letter-spacing: 0.7px;
    max-width: 62px;
  }
  .math-icon {
    font-size: 50px;
  }
  .mode-title {
    font-size: 23px;
    letter-spacing: -0.8px;
  }
  .mode-description {
    font-size: 11px;
    line-height: 1.7;
    margin-top: 7px;
  }
  .mode-bottom {
    font-size: 9px;
    padding-top: 20px;
    gap: 4px;
  }
  .mode-arrow {
    height: 24px;
    width: 24px;
  }
  .mode-arrow svg {
    height: 14px;
    width: 14px;
  }
  .family-link {
    font-size: 10px;
    gap: 8px;
    margin: 16px auto 21px;
  }
  .family-link > span:last-child {
    margin-left: 0;
  }
  .family-icon svg {
    width: 18px;
  }
  .home-progress {
    padding-top: 19px;
  }
  .progress-heading {
    margin-bottom: 20px;
  }
  .progress-heading h2 {
    font-size: 14px;
  }
  .progress-heading a {
    font-size: 10px;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 21px;
    column-gap: 20px;
  }
  .stats-row > div {
    padding-left: 0;
  }
  .stats-row > div:nth-child(2) {
    border: 0;
  }
  .stats-row strong {
    font-size: 26px;
  }
  .stats-row > div > span {
    font-size: 10px;
  }
  .stat-decoration {
    font-size: 14px;
  }
  .mastery-track {
    margin-top: 22px;
  }
  .app-footer {
    padding: 29px 0 24px;
    font-size: 9px;
    align-items: center;
    flex-direction: column;
    gap: 7px;
  }
  .setup-screen,
  .progress-screen,
  .settings-screen {
    padding-top: 16px;
  }
  .page-heading {
    margin: 17px 0 25px;
  }
  .page-heading h1 {
    font-size: 38px;
    letter-spacing: -1.7px;
  }
  .page-heading p {
    font-size: 14px;
  }
  .page-heading .eyebrow {
    font-size: 9px;
  }
  .setup-panel {
    padding: 23px 18px;
    border-radius: 19px;
  }
  legend {
    font-size: 16px;
  }
  .presets {
    gap: 0;
    justify-content: space-between;
  }
  .preset {
    font-size: 11px;
    padding: 8px;
  }
  .table-chips {
    gap: 7px;
  }
  .table-chip {
    height: 46px;
    border-radius: 9px;
    font-size: 18px;
  }
  .length-option {
    font-size: 10px;
    padding: 12px 4px;
  }
  .length-option strong {
    display: block;
    margin: 0;
    font-size: 23px;
  }
  .field-note {
    font-size: 11px;
  }
  .practice-screen {
    padding-top: 18px;
  }
  .practice-top {
    flex-wrap: wrap;
    gap: 6px;
  }
  .practice-top .eyebrow {
    display: none;
  }
  .practice-top .back-link {
    font-size: 12px;
  }
  .question-count {
    font-size: 12px;
  }
  .session-track {
    margin-top: 8px;
  }
  .practice-workspace {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 25px auto 0;
    max-width: 380px;
  }
  .problem-side,
  .keypad-side {
    width: 100%;
  }
  .problem-eyebrow {
    font-size: 8px;
  }
  .equation {
    font-size: 70px;
    gap: 23px;
    margin: 15px 0 17px;
  }
  .answer {
    height: 75px;
    width: 158px;
    border-radius: 14px;
    font-size: 41px;
  }
  .feedback {
    min-height: 52px;
    font-size: 12px;
  }
  .keypad {
    gap: 9px;
  }
  .key {
    height: 58px;
    font-size: 24px;
    border-radius: 11px;
  }
  .keyboard-note {
    display: none;
  }
  .review-note {
    font-size: 10px;
    margin: 24px 0 12px;
  }
  .is-practicing .app-footer {
    padding-top: 20px;
  }
  .hint {
    margin-bottom: 16px;
  }
  .hint h2 {
    font-size: 15px;
  }
  .hint p {
    font-size: 13px;
  }
  .hint-visible {
    display: none;
  }
  .complete-screen {
    padding-top: 30px;
  }
  .complete-screen h1 {
    font-size: 39px;
  }
  .complete-screen > p {
    font-size: 14px;
  }
  .complete-screen .eyebrow {
    font-size: 8px;
  }
  .completion-mark {
    width: 60px;
    height: 60px;
    font-size: 30px;
    margin-bottom: 22px;
  }
  .result-score > strong {
    font-size: 55px;
  }
  .result-stats strong {
    font-size: 25px;
  }
  .result-stats span {
    font-size: 10px;
  }
  .completion-actions > .button {
    width: 100%;
  }
  .progress-totals {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px 10px;
  }
  .progress-totals strong {
    font-size: 25px;
  }
  .progress-totals span {
    font-size: 10px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 28px;
  }
  .section-heading h2 {
    font-size: 17px;
  }
  .table-progress {
    column-gap: 22px;
  }
  .table-progress-row {
    gap: 7px;
  }
  .table-progress-row strong {
    width: 23px;
    font-size: 14px;
  }
  .table-progress-row > span:last-child {
    display: none;
  }
  .table-progress-row > span:nth-last-child(2) {
    width: 28px;
    font-size: 10px;
  }
  .achievements {
    column-gap: 16px;
  }
  .achievement {
    align-items: flex-start;
    gap: 9px;
  }
  .achievement-symbol {
    height: 33px;
    width: 33px;
    font-size: 17px;
  }
  .achievement h3 {
    font-size: 11px;
  }
  .achievement p {
    font-size: 10px;
  }
  .fact-row {
    gap: 10px;
  }
  .fact-row > strong {
    font-size: 17px;
    width: 80px;
  }
  .fact-row > span:last-child {
    font-size: 10px;
  }
  .fact-dots {
    gap: 4px;
  }
  .fact-dots i {
    height: 7px;
    width: 7px;
  }
  .setting-row {
    gap: 17px;
    padding: 21px 0;
  }
  .setting-row strong {
    font-size: 14px;
  }
  .setting-row small {
    font-size: 11px;
    max-width: 190px;
  }
  .setting-row select {
    max-width: 145px;
    font-size: 11px;
    padding: 8px;
  }
  .setting-row .button {
    padding: 10px 14px;
    font-size: 11px;
  }
  .empty-screen h1 {
    font-size: 29px;
  }
  .empty-screen p {
    font-size: 14px;
  }
  .empty-symbol {
    margin-top: 45px;
  }
}
@media (max-width: 360px) {
  .app-shell {
    padding-inline: 16px;
  }
  .nav-progress span {
    display: none;
  }
  .mode-card {
    padding: 17px 14px;
  }
  .mode-title {
    font-size: 21px;
  }
  .mode-tag {
    font-size: 6px;
  }
  .mode-bottom {
    font-size: 8px;
  }
  .family-link {
    font-size: 9px;
  }
  .table-chips {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-height: 650px) and (min-width: 701px) {
  .is-practicing .app-header {
    height: 76px;
  }
  .practice-workspace {
    margin-top: 23px;
    margin-bottom: 0;
  }
  .practice-screen {
    padding-top: 14px;
  }
  .key {
    height: 54px;
  }
  .review-note {
    margin: 18px 0;
  }
  .is-practicing .app-footer {
    padding-top: 20px;
  }
  .hint {
    padding: 12px;
  }
  .hint p {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@supports (padding: max(0px)) {
  .app-shell {
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(22px, env(safe-area-inset-right));
  }
  .app-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 700px) {
  .icon-button {
    width: 44px;
    height: 44px;
  }
  .mode-description {
    font-size: 12px;
  }
  .mode-card {
    min-height: 224px;
  }
}

/* Native modal keeps the current question visible and makes the game inert. */
body:has(dialog[open]) {
  overflow: hidden;
}
.settings-dialog {
  max-width: 640px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 24px 30px;
  overscroll-behavior: contain;
}
.settings-dialog[open] {
  animation: arrive 0.2s ease both;
}
.settings-dialog .settings-screen {
  padding: 0;
}
.settings-dialog-toolbar {
  display: flex;
  justify-content: flex-end;
}
.settings-dialog-toolbar .icon-button {
  background: transparent;
  font-size: 27px;
  font-weight: 400;
}
.settings-dialog .page-heading {
  margin: 0 0 22px;
}
.settings-dialog .page-heading h2 {
  font-size: 36px;
  letter-spacing: -1.5px;
  margin: 8px 0 12px;
}
.settings-dialog .page-heading p {
  font-size: 13px;
}
.settings-dialog .setting-row {
  padding: 17px 0;
}
.settings-dialog .reset-row {
  margin-top: 8px;
}
.settings-dialog .settings-saved {
  font-size: 12px;
  margin-top: 16px;
}
.resume-quest {
  width: 100%;
  margin-top: 16px;
}
@media (max-width: 700px) {
  .settings-dialog {
    padding: 18px 20px;
  }
  .settings-dialog .page-heading h2 {
    font-size: 31px;
  }
  .settings-dialog .setting-row {
    gap: 12px;
  }
  .settings-dialog .setting-row select {
    max-width: 132px;
  }
}
