.focus-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}
.focus-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .7rem 1rem;
}
.focus-kicker { margin: 0; font-weight: 800; text-align: center; }
.focus-tools { display: flex; gap: .35rem; }
.focus-progress {
  height: 8px;
  background: var(--navy-soft);
}
.focus-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width .35s ease;
}
.focus-main {
  width: min(720px, calc(100% - 1.5rem));
  margin: 1rem auto 2rem;
}
.step-card {
  background: white;
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transition: transform .18s ease;
}
.step-card h1 { font-size: 1.55rem; margin-bottom: .6rem; }
.step-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.expression-stage {
  background: var(--blue-soft);
  border-radius: 24px;
  padding: 1.2rem .8rem;
  text-align: center;
  margin: 1rem 0;
  overflow-x: auto;
}
.step-html { overflow-x: auto; max-width: 100%; }
.math-lg { overflow-x: auto; max-width: 100%; }
.math-keypad {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
  margin: .65rem 0 .15rem;
}
.math-keypad .chip { width: 100%; min-height: 48px; padding: 0 .2rem; }
.math-figure { margin: 1rem 0; overflow-x: auto; text-align: center; }
.coord-grid, .number-line-svg { width: min(100%, 320px); height: auto; display: block; margin: 0 auto; }
.coord-grid .grid { stroke: #d5dbe8; stroke-width: 1; }
.coord-grid .axis { stroke: var(--navy); stroke-width: 1.6; }
.coord-grid .plot-line { stroke: var(--blue); stroke-width: 2.2; fill: none; }
.coord-grid .plot-point, .number-line-svg .plot-point { fill: var(--coral); }
.coord-grid .open-point, .number-line-svg .open-point { fill: white; stroke: var(--navy); stroke-width: 2; }
.coord-grid text, .number-line-svg text { font-size: 10px; font-weight: 800; fill: var(--navy); }
.coord-grid .axis-label, .coord-grid .point-label { font-size: 11px; }
.number-line-svg .axis { stroke: var(--navy); stroke-width: 1.6; }
.demo-line {
  min-height: 3.2rem;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: .4s ease;
}
.demo-line.show { opacity: 1; transform: none; }

.explanation-step {
  display: grid;
  gap: .8rem;
  align-items: center;
  padding: 1rem;
  margin: .75rem 0;
  border-radius: 22px;
  background: var(--blue-soft);
}
.explanation-step__number {
  align-self: start;
  justify-self: start;
  border-radius: 999px;
  background: white;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 900;
  padding: .3rem .65rem;
  white-space: nowrap;
}
.explanation-step__math { min-width: 0; text-align: center; overflow-x: auto; padding: .3rem; }
.explanation-step__text { margin: 0; color: var(--muted); font-weight: 700; }
@media (min-width: 680px) {
  .explanation-step { grid-template-columns: auto minmax(150px, .8fr) minmax(220px, 1.2fr); }
  .explanation-step__text { padding-left: 1rem; border-left: 1px solid rgb(36 48 74 / .12); }
}

.session-streak {
  width: fit-content;
  margin: 0 0 .7rem auto;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: .84rem;
  font-weight: 900;
}
.session-streak.is-milestone { animation: streak-pop .42s ease both; background: var(--yellow-soft); color: var(--navy); }
.attempt-incorrect { animation: attempt-nudge .22s ease; }

.first-course-complete .check { animation: complete-pop .42s ease both; }
.unlock-notice {
  width: fit-content;
  margin: 1rem auto;
  border-radius: 18px;
  padding: .7rem 1rem;
  background: var(--yellow-soft);
  font-weight: 800;
}

@keyframes attempt-nudge {
  35% { transform: translateX(-3px); }
  70% { transform: translateX(2px); }
}
@keyframes streak-pop {
  50% { transform: scale(1.08); }
}
@keyframes complete-pop {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: none; }
}

.number-line {
  position: relative;
  height: 72px;
  margin: 1.2rem 0;
}
.number-line-track {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 34px;
  height: 6px;
  background: var(--coral);
  border-radius: 99px;
}
.endpoint {
  position: absolute;
  top: 22px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid var(--navy);
  background: white;
  transform: translateX(-50%);
  cursor: pointer;
}
.endpoint.closed { background: var(--navy); }

@media (max-width: 560px) {
  .math-keypad { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .answer-input { min-height: 58px; font-size: 1.2rem; }
  .expression-stage .katex-display { font-size: 1.05em; }
}

.complete-screen { text-align: center; padding: 1.5rem .5rem 2rem; }
.complete-screen .check {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 50%; background: var(--green); color: white;
  display: grid; place-items: center; position: relative;
}
.complete-screen .check::after {
  content: "";
  width: 18px;
  height: 32px;
  border-right: 4px solid white;
  border-bottom: 4px solid white;
  transform: rotate(45deg) translate(-2px, -4px);
}
@media (max-width: 720px) {
  .focus-main { width: min(720px, calc(100% - 1rem)); }
  .expression-stage { position: sticky; top: 0; z-index: 2; }
  .step-actions .btn { min-height: 48px; }
}
