/* Reading layout for the mathematics series only. */
.mathematics-page main {
  width: min(calc(100% - 3rem), 52rem);
  margin-inline: auto;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.mathematics-page .content {
  width: 100%;
  max-width: none;
  margin-top: 2rem;
}

.mathematics-page header.reader-entry {
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}

.mathematics-page header.reader-entry h1 {
  max-width: 24ch;
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  overflow-wrap: normal;
  word-break: normal;
}

.mathematics-page header.reader-entry .kicker {
  margin-bottom: 1rem;
  font-size: .75rem;
  line-height: 1.6;
}

.mathematics-page header.reader-entry .byline {
  max-width: 48rem;
  margin-top: 1rem;
  font-size: .9375rem;
  line-height: 1.6;
}

.mathematics-page header.reader-entry .knife-declaration {
  max-width: 48rem;
  margin: 1.5rem 0 0;
  font-size: 1.2rem;
  line-height: 1.55;
  letter-spacing: 0;
}

.mathematics-page header.reader-entry .actions {
  margin-top: 1.5rem;
}

.mathematics-page .content section {
  display: block;
  grid-template-columns: none;
  min-width: 0;
  padding: clamp(2rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--line, #373737);
}

.mathematics-page .content section > h2 {
  max-width: none;
  margin: 0 0 1.25rem;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.02em;
  text-transform: none;
  overflow-wrap: normal;
  word-break: normal;
}

.mathematics-page .prose,
.mathematics-page .reader-note,
.mathematics-page .citation {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.mathematics-page .prose p,
.mathematics-page .prose li {
  font-size: 1.125rem;
  line-height: 1.7;
}

.mathematics-page .prose p {
  margin: 0 0 1.2em;
}

.mathematics-page .prose > :last-child {
  margin-bottom: 0;
}

.mathematics-page .reader-note,
.mathematics-page .prose p.note,
.mathematics-page .prose p.reader-note {
  color: #b5b5b5;
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page .prose > .reader-note:first-child {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.mathematics-page main details.reader-toc,
.mathematics-page main details.reader-meta {
  max-width: none;
  margin: 1rem 0;
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page main details.reader-toc > summary,
.mathematics-page main details.reader-meta > summary {
  display: list-item;
  min-height: 44px;
  padding: .75rem 0;
  list-style-position: inside;
  line-height: 1.5;
  cursor: pointer;
}

.mathematics-page main details.reader-toc[open] > summary,
.mathematics-page main details.reader-meta[open] > summary {
  margin-bottom: .5rem;
}

.mathematics-page main details.reader-toc > nav > ul {
  margin: 0 0 .5rem;
  padding-left: 1.25rem;
}

.mathematics-page main details.reader-toc li {
  margin: 0;
  padding: 0;
}

.mathematics-page main details.reader-toc li > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: .5rem 0;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mathematics-page main details.reader-meta > section,
.mathematics-page main details.reader-meta > div > section {
  display: block;
  max-width: none;
  margin: 0;
  padding: 1rem 0 1.5rem;
  border: 0;
}

.mathematics-page main details.reader-meta section > h2 {
  max-width: none;
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.4;
  letter-spacing: -.01em;
  text-transform: none;
}

.mathematics-page .math-example {
  margin: 1.5rem 0;
}

.mathematics-page .math-example > p.math-expression {
  margin: 0;
  padding: 1.5rem 1rem;
  border: 1px solid var(--line, #373737);
  text-align: center;
  font-size: 2rem;
  line-height: 1.4;
}

.mathematics-page .math-expression code {
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.mathematics-page .math-cases {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.mathematics-page .math-case {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line, #373737);
}

.mathematics-page .math-case > h3 {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.mathematics-page .math-case dl {
  margin: 0;
}

.mathematics-page .math-case dl > div + div {
  margin-top: 1rem;
}

.mathematics-page .math-case dt {
  margin: 0 0 .25rem;
  color: #b5b5b5;
  font-size: .9375rem;
  line-height: 1.5;
}

.mathematics-page .math-case dd {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.mathematics-page .math-phase-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
}

.mathematics-page .math-phase-nav a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.5;
}

.mathematics-page .phase-spine {
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.mathematics-page .phase-spine > .phase {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  margin: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line, #373737);
  scroll-margin-top: 1.5rem;
}

.mathematics-page .phase-spine > .phase + .phase {
  margin-top: 0;
}

.mathematics-page .phase-spine > .phase:last-child {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line, #373737);
}

.mathematics-page .phase::before {
  display: none;
  content: none;
}

.mathematics-page .phase > div {
  min-width: 0;
}

.mathematics-page .phase-number {
  padding-top: .2rem;
  color: #b5b5b5;
  font-size: .8125rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.mathematics-page .phase-title {
  display: block;
  max-width: none;
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.015em;
  text-transform: none;
  overflow-wrap: normal;
  word-break: normal;
}

.mathematics-page .phase-subtitle {
  display: block;
  max-width: none;
  margin-top: .65rem;
  color: #b5b5b5;
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page .phase-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  margin-top: .5rem;
  padding: .5rem 0;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.mathematics-page .phase-none {
  margin-top: .5rem;
  color: #b5b5b5;
  font-size: .875rem;
  line-height: 1.6;
}

.mathematics-page .boundary-grid {
  display: block;
}

.mathematics-page .boundary-panel {
  margin: 1.75rem 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line, #373737);
}

.mathematics-page .boundary-panel h3 {
  margin: 0 0 .75rem;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.mathematics-page .boundary-grid > .knife-declaration,
.mathematics-page .boundary-grid > .knife-subtitle {
  max-width: none;
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  line-height: 1.65;
  letter-spacing: 0;
  text-wrap: wrap;
}

.mathematics-page .self-strip,
.mathematics-page .challenge {
  padding: 0;
  border: 0;
}

.mathematics-page .self-strip p {
  font-size: 1.125rem;
  line-height: 1.7;
  letter-spacing: 0;
}

.mathematics-page .self-guard {
  margin: .5rem 0 0;
  padding-left: 1rem;
}

.mathematics-page .self-guard span {
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page .challenge h3 {
  max-width: none;
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  letter-spacing: -.025em;
}

.mathematics-page .challenge p {
  max-width: none;
}

.mathematics-page .cut-sequence li {
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
}

.mathematics-page .cut-sequence li > div {
  min-width: 0;
}

.mathematics-page .cut-sequence strong {
  font-size: 1.125rem;
  line-height: 1.5;
}

.mathematics-page .cut-sequence span {
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page .knife-status {
  min-width: 0;
  max-width: 100%;
  margin: 1.25rem 0;
  font-size: .8125rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.mathematics-page .prose code,
.mathematics-page .hash-line,
.mathematics-page .release-coordinate {
  overflow-wrap: anywhere;
  word-break: normal;
}

.mathematics-page .release-group + .release-group {
  margin-top: 2rem;
}

.mathematics-page .release-heading {
  margin-bottom: .75rem;
  font-size: 1.125rem;
  line-height: 1.5;
}

.mathematics-page .file {
  align-items: baseline;
  gap: .5rem 1rem;
  min-height: 44px;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.mathematics-page .file > span {
  min-width: 0;
}

.mathematics-page .file span:last-child {
  font-size: .875rem;
  letter-spacing: 0;
}

.mathematics-page .citation {
  padding: 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  color: #e3e3e3;
  overflow-wrap: anywhere;
  word-break: normal;
}

.mathematics-page .math-citation-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin: .75rem 0 1.25rem;
}

.mathematics-page button.math-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: .65rem .9rem;
  border: 1px solid #777;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .9375rem;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
}

.mathematics-page .prose p.math-copy-status {
  flex: 1 1 12rem;
  margin: 0;
  color: #b5b5b5;
  font-size: .9375rem;
  line-height: 1.6;
}

.mathematics-page .reader-related {
  margin: 0;
  padding: 0;
  border: 0;
}

.mathematics-page .boundary-update {
  max-width: none;
  margin: 1.5rem 0 0;
  font-size: 1rem;
  line-height: 1.65;
}

.mathematics-page .boundary-update a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.mathematics-page main [id] {
  scroll-margin-top: 1.5rem;
}

.mathematics-page main a:focus-visible,
.mathematics-page main summary:focus-visible,
.mathematics-page button.math-copy:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (min-width: 600px) {
  .mathematics-page .math-cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .mathematics-page main {
    width: calc(100% - 2rem);
    padding-top: 1.5rem;
  }

  .mathematics-page header.reader-entry h1 {
    max-width: none;
    font-size: clamp(2rem, 8vw, 2.75rem);
  }

  .mathematics-page .content {
    margin-top: 1.5rem;
  }

  .mathematics-page .prose p,
  .mathematics-page .prose li,
  .mathematics-page .self-strip p {
    font-size: 1.0625rem;
    line-height: 1.7;
  }

  .mathematics-page .prose p.note,
  .mathematics-page .prose p.reader-note {
    font-size: 1rem;
  }

  .mathematics-page .phase-spine > .phase,
  .mathematics-page .cut-sequence li {
    grid-template-columns: 1.625rem minmax(0, 1fr);
    gap: .75rem;
  }

  .mathematics-page .phase-spine > .phase {
    padding: 1.5rem 0;
  }

  .mathematics-page .math-case,
  .mathematics-page .citation {
    padding: 1rem;
  }

  .mathematics-page .file {
    flex-direction: column;
    align-items: flex-start;
  }

  .mathematics-page .prose p.math-copy-status {
    font-size: .9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mathematics-page {
    scroll-behavior: auto;
  }

  .mathematics-page * {
    scroll-behavior: auto;
  }
}

@media print {
  .mathematics-page main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .mathematics-page header.reader-entry h1 {
    font-size: 26pt;
  }

  .mathematics-page .math-phase-nav,
  .mathematics-page .math-citation-tools {
    display: none !important;
  }

  .mathematics-page .content section {
    padding: 1.25rem 0;
  }

  .mathematics-page .content section > h2,
  .mathematics-page .phase-title,
  .mathematics-page .boundary-panel h3 {
    break-after: avoid;
  }

  .mathematics-page .phase-spine > .phase,
  .mathematics-page .math-case,
  .mathematics-page .citation {
    break-inside: avoid;
  }

  .mathematics-page .math-cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mathematics-page .phase::before {
    display: none;
  }

  .mathematics-page .reader-note,
  .mathematics-page .prose p.note,
  .mathematics-page .prose p.reader-note,
  .mathematics-page .phase-number,
  .mathematics-page .phase-subtitle,
  .mathematics-page .phase-none,
  .mathematics-page .math-case dt,
  .mathematics-page .citation {
    color: #333;
  }

  .mathematics-page .knife-status {
    color: #333;
    font-size: 8pt;
  }

  .mathematics-page .math-case,
  .mathematics-page .math-example > p.math-expression,
  .mathematics-page .phase-spine > .phase,
  .mathematics-page .boundary-panel,
  .mathematics-page .citation {
    border-color: #bbb;
  }
}
