.notes-intro {
  max-width: 48rem;
  margin: 1.1rem 0 0;
  color: #445957;
  font-size: .9rem;
}

.notes-main h2 {
  scroll-margin-top: 8.5rem;
}

.notes-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
}

.notes-breadcrumb a {
  font-weight: 750;
}

.notes-breadcrumb a:hover,
.notes-breadcrumb a:focus-visible {
  text-decoration: underline;
}

.notes-breadcrumb [aria-current="page"] {
  color: var(--ink);
}

.notes-rail {
  align-self: start;
  position: sticky;
  top: 7rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 8.5rem);
  overflow: auto;
  padding-right: .2rem;
}

.notes-summary,
.notes-toc,
.notes-exit {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 253, 248, .9);
}

.notes-summary h2,
.notes-toc h2 {
  margin: 0 0 1rem;
  font: 500 1.25rem/1.2 Georgia, serif;
}

.notes-summary dl {
  margin: 0;
}

.notes-summary dl div {
  display: grid;
  grid-template-columns: minmax(5.4rem, .8fr) minmax(0, 1.2fr);
  gap: .6rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}

.notes-summary dt {
  color: var(--ink);
  font-size: .7rem;
  font-weight: 800;
}

.notes-summary dd {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}

.notes-toc ol {
  display: grid;
  gap: .15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: notes-toc;
}

.notes-toc li {
  counter-increment: notes-toc;
}

.notes-toc a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: .35rem;
  min-height: 40px;
  align-items: center;
  padding: .35rem .25rem;
  color: var(--ink);
  font-size: .74rem;
  font-weight: 720;
  text-decoration: none;
}

.notes-toc a::before {
  content: counter(notes-toc, decimal-leading-zero);
  color: var(--teal);
  font-size: .58rem;
  letter-spacing: .05em;
}

.notes-toc a:hover,
.notes-toc a:focus-visible {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: .2rem;
}

.notes-exit {
  display: grid;
  gap: .45rem;
}

.notes-exit a,
.notes-mobile-actions a {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--teal);
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
}

.notes-exit a + a,
.notes-mobile-actions a + a {
  border-top: 1px solid var(--line);
}

.notes-mobile-navigation {
  display: none;
}

.notes-end-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}

.notes-end-nav div {
  display: grid;
  gap: .25rem;
}

.notes-end-nav span {
  color: var(--teal);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notes-end-nav strong {
  font: 500 1.2rem/1.2 Georgia, serif;
}

.notes-end-nav a {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}

.notes-end-nav a.secondary {
  grid-column: 2;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .notes-rail {
    display: none;
  }

  .notes-mobile-navigation {
    display: grid;
    gap: .75rem;
    margin-bottom: 2rem;
  }

  .notes-mobile-toc,
  .notes-mobile-summary {
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: var(--white);
  }

  .notes-mobile-toc summary,
  .notes-mobile-summary summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    color: var(--teal);
    font-weight: 800;
    cursor: pointer;
  }

  .notes-mobile-toc nav,
  .notes-mobile-summary dl {
    margin: 0;
    padding: 0 1rem 1rem;
  }

  .notes-mobile-toc ol {
    display: grid;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .notes-mobile-toc a {
    display: flex;
    min-height: 42px;
    align-items: center;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    border-top: 1px solid var(--line);
  }

  .notes-mobile-summary dl div {
    display: grid;
    grid-template-columns: minmax(6.5rem, .8fr) minmax(0, 1.2fr);
    gap: .75rem;
    padding: .5rem 0;
    border-top: 1px solid var(--line);
  }

  .notes-mobile-summary dt {
    font-size: .72rem;
    font-weight: 800;
  }

  .notes-mobile-summary dd {
    margin: 0;
    color: var(--muted);
    font-size: .74rem;
  }

  .notes-mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 .25rem;
  }
}

@media (max-width: 720px) {
  .notes-end-nav {
    grid-template-columns: 1fr;
    padding: 1.2rem;
  }

  .notes-end-nav a.secondary {
    grid-column: 1;
  }
}
