.mathfoundry-catalog {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 1.5rem 0;
}

.mathfoundry-challenge,
.mathfoundry-path,
.mathfoundry-notice {
  border: 1px solid #d8e2ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(26, 49, 79, 0.08);
}

.mathfoundry-challenge {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem;
}

.mathfoundry-challenge h3,
.mathfoundry-path h2 {
  margin: 0.2rem 0;
  color: #132a45;
  font-size: 1.25rem;
  line-height: 1.3;
}

.mathfoundry-kicker {
  margin: 0;
  color: #167d83;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mathfoundry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.mathfoundry-meta li {
  margin: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #edf8f7;
  color: #15585d;
  font-size: 0.78rem;
  font-weight: 600;
}

.mathfoundry-prompt {
  color: #17283c;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
}

.mathfoundry-answer-form {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
  border: 1px solid #d8e7e2;
  border-radius: 10px;
  background: #f3faf8;
}

.mathfoundry-answer-form > label {
  color: #15585d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mathfoundry-answer-form > div {
  display: flex;
  gap: 0.55rem;
}

.mathfoundry-answer-form input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0.65rem 0.75rem;
  border: 1px solid #aecfc9;
  border-radius: 7px;
  color: #102f54;
  background: #ffffff;
  font: inherit;
}

.mathfoundry-answer-form button {
  flex: 0 0 auto;
  padding: 0.65rem 0.85rem;
  border: 1px solid #0b777b;
  border-radius: 7px;
  color: #ffffff;
  background: #0b777b;
  font: inherit;
  font-weight: 800;
}

.mathfoundry-answer-form button:focus-visible,
.mathfoundry-answer-form input:focus-visible,
.mathfoundry-solution summary:focus-visible {
  outline: 3px solid rgba(69, 198, 191, 0.4);
  outline-offset: 2px;
}

.mathfoundry-answer-form button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.mathfoundry-feedback {
  display: none;
  margin: 0;
  padding: 0.62rem 0.7rem;
  border-radius: 7px;
  font-size: 0.87rem;
  line-height: 1.45;
}

.mathfoundry-feedback.is-correct,
.mathfoundry-feedback.is-try,
.mathfoundry-feedback.is-error {
  display: block;
}

.mathfoundry-feedback.is-correct { color: #155e4a; background: #e4f7ec; }
.mathfoundry-feedback.is-try { color: #765710; background: #fff4d8; }
.mathfoundry-feedback.is-error { color: #8f3d34; background: #fff0ed; }

.mathfoundry-answer {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 8px;
  background: #f2f8ff;
  color: #102f54;
}

.mathfoundry-answer span {
  color: #167d83;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mathfoundry-solution {
  padding-top: 0.2rem;
  border-top: 1px solid #e5edf5;
}

.mathfoundry-solution summary {
  cursor: pointer;
  color: #1c5c93;
  font-weight: 700;
}

.mathfoundry-solution ol {
  margin: 1rem 0;
  padding-left: 1.4rem;
}

.mathfoundry-solution li {
  margin: 0.5rem 0;
  line-height: 1.55;
}

.mathfoundry-summary,
.mathfoundry-conclusion {
  line-height: 1.55;
}

.mathfoundry-conclusion {
  padding: 0.75rem;
  border-left: 3px solid #f2a14a;
  background: #fffaf3;
  font-weight: 700;
}

.mathfoundry-path {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8fbff;
}

.mathfoundry-course-progress {
  display: inline-flex;
  margin: 1rem 0 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: #15585d;
  background: #e3f5ef;
  font-size: 0.8rem;
  font-weight: 700;
}

.mathfoundry-path > header > p:not(.mathfoundry-kicker) {
  margin-bottom: 0;
  color: #466077;
}

.mathfoundry-course-meta {
  margin-bottom: 0;
}

.mathfoundry-modules {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.mathfoundry-module {
  padding: 1.25rem;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #ffffff;
}

.mathfoundry-challenge.is-complete {
  border-color: #87c9aa;
  box-shadow: 0 8px 24px rgba(18, 113, 78, 0.12);
}

.mathfoundry-challenge.is-complete::before {
  content: '✓ Complete';
  align-self: flex-start;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  color: #155e4a;
  background: #e4f7ec;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mathfoundry-module h3 {
  margin: 0.2rem 0 0;
  color: #132a45;
  font-size: 1.15rem;
}

.mathfoundry-module-objective {
  margin: 0.7rem 0 0;
  color: #294563;
  line-height: 1.55;
}

.mathfoundry-module-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 1.1rem;
  padding: 0;
  list-style: none;
}

.mathfoundry-module-details li {
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 7px;
  background: #edf8f7;
  color: #15585d;
  font-size: 0.8rem;
  line-height: 1.35;
}

.mathfoundry-notice {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  color: #693a20;
  background: #fff7f1;
}

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

  .mathfoundry-challenge,
  .mathfoundry-path {
    padding: 1rem;
  }

  .mathfoundry-answer-form > div {
    flex-direction: column;
  }

  .mathfoundry-answer-form button {
    width: 100%;
  }
}
