.legal-summary {
  align-self: start;
  top: calc(var(--sticky-nav-offset, 92px) + 24px);
  max-height: calc(100vh - var(--sticky-nav-offset, 92px) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.legal-summary a {
  position: relative;
  display: inline-block;
  color: inherit;
  text-decoration: none;
  text-underline-offset: 5px;
  transition: color 180ms ease;
}

.legal-summary a::after {
  position: absolute;
  right: 100%;
  bottom: -4px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transition: right 220ms ease;
}

.legal-summary a:hover,
.legal-summary a:focus-visible,
.legal-summary a[aria-current="location"] {
  color: var(--terracotta-dark);
}

.legal-summary a:hover::after,
.legal-summary a:focus-visible::after,
.legal-summary a[aria-current="location"]::after {
  right: 0;
}

.legal-document section[id] {
  scroll-margin-top: calc(var(--sticky-nav-offset, 92px) + 28px);
}

@media (min-width: 821px) {
  .legal-layout {
    position: relative;
  }

  .js-enabled .legal-summary {
    position: relative;
    top: auto;
    z-index: 2;
  }
}

@media (max-width: 820px) {
  .legal-summary {
    max-height: none;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-summary a,
  .legal-summary a::after {
    transition: none;
  }
}
