/* Reset basic styles */
.md-typeset details {
  min-width: 0 !important;
  max-width: 100% !important;
}

.md-typeset .details-content {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
}

.md-typeset .arithmatex {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
  display: inline-block !important;
}

/* Force mjx-container to allow scrolling */
mjx-container {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

mjx-math {
  min-width: 0 !important;
}

/* A restrained reading hierarchy, with room for mathematical tables. */
.md-typeset h1 {
  color: var(--md-default-fg-color);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.md-typeset h2 {
  font-weight: 600;
  margin-top: 2em;
}

.md-typeset .md-button {
  margin: 0 0.4rem 0.5rem 0;
  border-radius: 0.2rem;
  padding: 0.55em 1.1em;
}

.md-typeset .catalog-collections ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.md-typeset .catalog-collections li {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.25rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .md-typeset .catalog-collections ul {
    grid-template-columns: 1fr;
  }
}
