.math-practice-option {
  display: block;
  grid-column: 1/-1;
  padding: 18px;
  background: #fff;
  border: 2px solid #a047cb;
  border-radius: 18px;
  font-size: 18px;
  line-height: 1.5;
}
.math-practice-option input {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}
.math-practice-option small {
  display: block;
  font-size: 14px;
}
.bf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  line-height: 1.5;
}
.bf-tools label,
.bf-tools details {
  width: 100%;
}
.bf-tools select {
  font: inherit;
  min-height: 44px;
  max-width: 100%;
}
.bf-tool {
  font: 700 16px/1.4 var(--font-ui);
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid #705194;
  border-radius: 16px;
  background: #fff;
  color: #302943;
  cursor: pointer;
}
.bf-tools summary {
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}
.bf-practice .bf-hud > span:nth-child(2),
.bf-practice .bf-ceiling i {
  display: none;
}
.bf-practice .bf-wall {
  box-shadow: inset 0 0 0 2px #e2eef9;
}
.bf-practice .bf-wall::after {
  display: none;
}
.bf-wrap:not(.bf-guided) .bf-ticks {
  visibility: hidden;
}
.bf-guided .bf-ticks {
  z-index: 2;
  pointer-events: none;
}
.bf-guided .bf-ticks i {
  background: #51405f;
  width: 2px;
  opacity: 0.7;
}
.bf-ruler-caption {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #51405f;
}
.bf-family {
  padding: 18px;
  background: #fff6d9;
  border: 2px solid #a97714;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
}
.mr-resource {
  text-align: left;
  margin: 16px 0;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  color: #302943;
  font: 400 16px/1.5 var(--font-ui, sans-serif);
}
.mr-resource h3 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 12px;
}
.mr-resource p {
  margin: 12px 0;
}
.mr-resource label {
  display: block;
  margin: 16px 0;
  font-size: 16px;
  font-weight: 700;
}
.mr-resource input[type='range'] {
  display: block;
  width: 100%;
  min-height: 44px;
}
.mr-resource select {
  font: inherit;
  min-height: 44px;
  padding: 4px;
}
.mr-resource button {
  font: 700 16px/1.4 var(--font-ui, sans-serif);
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid #705194;
  border-radius: 14px;
  background: #f7f1ff;
  color: #302943;
  cursor: pointer;
}
.mr-resource button:disabled {
  opacity: 0.5;
  cursor: default;
}
.mr-resource :focus-visible,
.bf-tools :focus-visible {
  outline: 3px solid #155ea8;
  outline-offset: 3px;
}
.mr-actions,
.mr-predict {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.mr-predict {
  border: 0;
  padding: 0;
}
.mr-predict legend {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.mr-feedback {
  min-height: 24px;
  padding: 12px;
  background: #f1f5ff;
  border-radius: 12px;
}
.mr-bar {
  position: relative;
  height: 48px;
  border: 2px solid #51405f;
  border-radius: 7px;
  overflow: hidden;
  background: #faf7ff;
}
.mr-fill {
  height: 100%;
  transition: width 0.25s ease;
}
.mr-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid #fff;
  box-shadow: -1px 0 #51405f;
}
.mr-equation {
  overflow-wrap: anywhere;
  font-weight: 700;
}
.mr-resource svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.mr-worked {
  width: 100%;
  border: 2px solid #cbb7e5;
  border-radius: 20px;
  margin: 20px 0;
  background: #faf6ff;
}
.math-level-resource {
  grid-column: 1/-1;
  min-width: 0;
  width: 100%;
}
.mr-worked > summary {
  cursor: pointer;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}
.mr-worked > summary small, .mr-open-label { display: block; font-size: 14px; font-weight: 400; margin-top: 6px; }
.mr-open-label { color: #563476; font-weight: 700; }
.mr-worked[open] > summary .mr-open-label { display: none; }
.mr-progress { display: flex; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; }
.mr-progress li { flex: 1; min-width: 0; }
.mr-progress button { width: 100%; padding: 10px 4px; font-size: 16px; }
.mr-progress [aria-current='step'] { color: white; background: #654086; border-color: #654086; box-shadow: 0 3px 0 #cbb7e5; }
.mr-resource [hidden] { display: none !important; }
.mr-stage-title { scroll-margin-top: 24px; }
.mr-direction, .mr-control-help { color: #51405f; }
.mr-control-help { display: block; font-size: 14px; font-weight: 400; }
.mr-equation-box { border: 2px solid #a58bbd; border-radius: 14px; padding: 12px; background: #faf6ff; }
.mr-equation-box h4 { margin: 0; font-size: 16px; }
.mr-navigation { justify-content: space-between; }
.mr-navigation [data-step='next'] { background: #654086; color: white; flex: 1; }
.mr-secondary { padding-top: 12px; border-top: 1px solid #ded2e9; }
.mr-secondary button { background: white; font-size: 14px; }
@media (max-width: 420px) { .mr-resource { padding: 12px; } .mr-navigation { flex-direction: column-reverse; } }
.mr-resource details {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #cbb7e5;
  border-radius: 12px;
}
.mr-resource summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}
.mr-resource a {
  color: #155ea8;
  text-decoration: underline;
}
.mr-words details {
  padding: 12px 0;
  border: 0;
}
.mr-resource button[aria-pressed='true'] {
  background: #705194;
  color: #fff;
}
.mr-step {
  border-left: 4px solid #a047cb;
  padding: 12px;
  background: #faf6ff;
}
.mr-car {
  animation: mr-trip 0.9s ease-in-out both;
}
@keyframes mr-trip {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--travel));
  }
}
@media (prefers-reduced-motion: reduce) {
  .mr-resource * {
    transition: none !important;
    animation: none !important;
  }
}

#bf-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border: 3px dashed #2376bc;
  background: #2376bc33;
  pointer-events: none;
  z-index: 4;
}
#bf-ghost.too-big {
  border-color: #b63827;
  background: #b6382733;
}
