html:has(body.spec-reader), body.spec-reader { overflow-x: clip; }
.spec-reader .masthead a:first-child { display: inline-flex; align-items: center; gap: .5rem; }
.spec-reader .masthead nav { align-items: center; max-width: 90rem; }
.spec-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  max-width: 90rem;
  margin-inline: auto;
}
.spec-rail {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100dvh;
  overflow: auto;
  padding: 1.75rem 1.25rem;
  border-inline-end: 1px solid #ded3da;
  background: #f7eff7;
}
.spec-reader main {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding-inline: clamp(1rem, 4vw, 3rem);
}
.spec-chapter { min-width: 0; overflow-x: clip; }
.spec-chapter pre, .spec-chapter .katex-display { min-width: 0; }
.chapter-group + .chapter-group { margin-top: 1.2rem; }
.chapter-group ul { list-style: none; margin: .25rem 0 0; padding: 0; }
.chapter-group a { display: block; padding: .3rem 0; line-height: 1.35; }
.spec-chapter { margin-block-start: 2.75rem; padding-block-start: 2rem; border-top: 1px solid #ded3da; }
.spec-chapter h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.spec-chapter h3, .spec-chapter h4 { margin-block-start: 1.7em; }
.spec-chapter pre, .spec-chapter .table-wrap, .spec-chapter table, .spec-chapter .katex-display {
  max-width: 100%;
  overflow-x: auto;
}
.spec-chapter table { display: block; }
.spec-chapter .mermaid svg { max-inline-size: 100%; height: auto; }
.spec-chapter pre { padding: 1rem; border: 1px solid #ded3da; background: #fff; }
.spec-chapter img { max-width: 100%; height: auto; }
.spec-chapter :target { background: #f4e4f5; }
.spec-source { color: #644863; font-size: .9rem; }
.spec-mobile-outline { display: none; }

@media (max-width: 62rem) {
  .spec-layout { display: block; }
  .spec-rail { display: none; }
  .spec-mobile-outline { display: block; }
  .spec-mobile-outline nav { margin-top: 1rem; }
}
@media print {
  .spec-rail, .spec-mobile-outline, .spec-reader .masthead, .spec-reader .skip { display: none; }
  .spec-layout { display: block; }
}
