/* Privacy and terms: a quiet reading column with room for section navigation. */
.doc { position: relative; }
.doc-in { width: min(68ch, 100% - 2 * var(--gutter)); margin-inline: auto; }

.doc h1 {
  font-size: clamp(42px, 5.7vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.047em;
  margin-bottom: 16px;
}
.doc .doc-meta {
  width: fit-content;
  max-width: 100%;
  padding: 9px 13px;
  margin-bottom: 34px;
  border-left: 2px solid var(--red);
  border-radius: 0 10px 10px 0;
  background: #f7f7f8;
  color: #55555b;
  font-size: 14px;
  line-height: 1.5;
}
.doc h2 {
  margin: 60px 0 17px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
  font-size: clamp(24px, 2.5vw, 29px);
  line-height: 1.22;
  letter-spacing: -0.032em;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.doc h2:focus { outline: none; }
.doc h2:focus-visible { outline: 3px solid #005fcc; outline-offset: 5px; border-radius: 3px; }
.doc h3 {
  margin: 34px 0 10px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.doc p, .doc li {
  color: #3c3c40;
  font-size: 17px;
  line-height: 1.72;
  overflow-wrap: break-word;
}
.doc p + p { margin-top: 17px; }
.doc ul, .doc ol { margin: 14px 0; padding-left: 1.35em; }
.doc li + li { margin-top: 7px; }
.doc a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1.25px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: auto;
}
.doc a:hover { text-decoration-thickness: 2px; }
.doc code {
  padding: 2px 5px;
  border: 1px solid #e7e7eb;
  border-radius: 5px;
  background: #f5f5f7;
  color: #303035;
  font-size: .84em;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
}

/* The rail is absolutely placed so adding its contents cannot move the text. */
.doc-toc {
  position: absolute;
  z-index: 1;
  inset-block: 0;
  left: max(var(--gutter), calc(50% - 34ch - 9.25rem));
  width: 12.5rem;
  pointer-events: none;
}
.doc-toc details {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 40px);
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: thin;
}
.doc-toc summary {
  display: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -4px 2px 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.doc-toc details[open] summary::after { margin-top: 4px; transform: rotate(225deg); }
.doc .doc-toc-label {
  margin: 0 0 8px 13px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.doc-toc nav { border-left: 1px solid var(--line-2); }
.doc-toc ul { margin: 0; padding: 0; list-style: none; }
.doc-toc li + li { margin-top: 2px; }
.doc-toc a {
  display: block;
  min-height: 34px;
  padding: 7px 10px 7px 13px;
  border-left: 2px solid transparent;
  color: #626268;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  transform: translateX(-1px);
}
.doc-toc a:hover, .doc-toc a:focus-visible {
  border-left-color: var(--red);
  color: var(--ink);
}
.doc-toc a:focus-visible { outline-offset: 2px; }

@media (min-width: 1101px) {
  .js .doc-in {
    width: min(68ch, calc(100% - 2 * var(--gutter)));
    margin-left: max(var(--gutter), calc(50% - 34ch + 7.5rem));
    margin-right: 0;
  }
}

@media (max-width: 1100px) {
  .js .doc { padding-top: calc(var(--nav-h) + clamp(56px, 8vw, 104px) + 58px); }
  .doc-toc {
    inset: auto var(--gutter) auto;
    top: calc(var(--nav-h) + 14px);
    width: auto;
  }
  .doc-toc details {
    max-height: min(54vh, 420px);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
  }
  .doc-toc summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
  }
  .doc-toc nav { border: 0; }
  .doc-toc-label { display: none; }
  .doc-toc ul { padding: 0 10px 10px; }
  .doc-toc a {
    min-height: 42px;
    padding: 10px 10px 10px 12px;
    border-left-width: 2px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .doc h1 { font-size: clamp(40px, 11vw, 48px); }
  .doc .doc-meta { margin-bottom: 30px; font-size: 13.5px; }
  .doc h2 { margin-top: 48px; padding-top: 19px; }
  .doc p, .doc li { font-size: 16px; line-height: 1.7; }
  .doc p + p { margin-top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-toc summary::after { transition: none; }
}
