.md-typeset .material-videos {
  margin: 2rem 0;
  text-align: center;
}

.md-typeset .material-videos__figure {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
}

.material-videos__player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.35rem, 2vw, .8rem);
}

.material-videos__frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #15171b;
  border-radius: .6rem;
}

.md-typeset .material-videos__frame video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.md-typeset .material-videos__frame [hidden] {
  display: none;
}

.material-videos__play {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 600;
  cursor: pointer;
}

.material-videos__play::before {
  content: "";
  border-block: .23rem solid transparent;
  border-inline-start: .35rem solid currentColor;
}

.material-videos__play:hover,
.material-videos__play:focus-visible {
  background: var(--md-accent-fg-color);
}

.md-typeset .material-videos figcaption {
  margin: .65rem auto .15rem;
  font-style: normal;
  font-weight: 600;
}

.material-videos small {
  color: var(--md-default-fg-color--light);
}

.material-videos__next {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 50%;
  background: var(--md-default-bg-color);
  color: var(--md-primary-fg-color);
  cursor: pointer;
}

.material-videos__next::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-top: 2px solid;
  border-right: 2px solid;
  transform: translateX(-20%) rotate(45deg);
}

.material-videos__next:hover,
.material-videos__next:focus-visible {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.arithmatex:has(> mjx-container[display="true"]) {
  overflow-x: auto;
}

/* Preserve the MathJax width in display blocks and scrollable tables. */
.arithmatex > mjx-container[display="true"] > svg,
.md-typeset table .arithmatex > mjx-container > svg {
  max-width: none;
}

