nav#toc,
nav[role='doc-toc'] {
  break-before: page;
  font-size: 120%;

  li a::after {
    content: target-counter(attr(href), page);
  }

  li a {
    display: inline-flex;
    width: 100%;
    text-decoration: none;
    color: currentColor;
    align-items: baseline;
  }

  li a::before {
    margin-left: 0.5em;
    margin-right: 0.5em;
    border-bottom: solid 1px;
    content: '';
    order: 1;
    flex: auto;
  }

  li a::after {
    text-align: right;
    content: target-counter(attr(href), page);
    align-self: flex-end;
    flex: none;
    order: 2;
  }
}
