.doc-updated {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
}

.doc-updated time {
  color: var(--ink);
}

html.motion .doc-updated {
  animation: page-rise 0.7s var(--ease) 0.12s backwards;
}

.doc {
  padding: clamp(32px, 4vw, 56px) 0 var(--section);
}

.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 272px) minmax(0, 720px);
  align-items: start;
  gap: 40px clamp(48px, 7vw, 120px);
}

.doc-side {
  position: sticky;
  top: calc(var(--header) + 24px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.doc-nav {
  align-self: stretch;
}

.doc-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.doc-nav a i {
  flex: none;
  font-size: 18px;
}

.doc-nav [aria-current="page"] {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 600;
}

.doc-nav [aria-current="page"] i {
  color: var(--red);
}

.doc-toc {
  align-self: stretch;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.doc-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}

.doc-toc summary::-webkit-details-marker {
  display: none;
}

.doc-toc summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 4px 4px 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.5;
  rotate: 45deg;
  transition: rotate 0.25s var(--ease), margin 0.25s var(--ease);
}

.doc-toc[open] summary::after {
  margin: 4px 4px 0 0;
  rotate: 225deg;
}

.doc-toc ol {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.doc-toc a {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 6px 0 6px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.doc-toc a::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -1px;
  width: 2px;
  border-radius: 2px;
  background: var(--red);
  scale: 1 0;
  transition: scale 0.25s var(--ease);
}

.doc-toc a.is-on {
  color: var(--ink);
}

.doc-toc a.is-on::before {
  scale: 1 1;
}

.doc-toc-no {
  flex: none;
  min-width: 1.3em;
  font-variant-numeric: tabular-nums;
  color: rgba(17, 17, 17, 0.6);
}

.doc-cookie {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color 0.2s ease, scale 0.15s var(--ease);
}

.doc-cookie i {
  font-size: 18px;
  color: var(--red);
}

.doc-cookie:active {
  scale: 0.97;
}

.doc-body {
  min-width: 0;
}

.doc-body > p:first-child {
  font-size: 1.12em;
  line-height: 1.6;
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .doc-nav a:not([aria-current]):hover {
    background: var(--paper-2);
    color: var(--ink);
  }

  .doc-toc a:hover {
    color: var(--ink);
  }

  .doc-cookie:hover {
    background: #eeedf2;
  }
}

@media (pointer: coarse) {
  .doc-toc a {
    align-items: center;
    min-height: 44px;
  }
}

@media (min-width: 1024px) {
  .doc-side {
    max-height: calc(100svh - var(--header) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .doc-toc a:focus-visible {
    outline-offset: -2px;
    border-radius: 8px;
  }

  .doc-toc summary {
    pointer-events: none;
  }

  .doc-toc summary::after {
    display: none;
  }
}

@media (max-width: 1023px) {
  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-side {
    position: static;
    gap: 16px;
  }

  .doc-nav {
    margin-inline: calc(var(--gutter) * -1);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .doc-nav::-webkit-scrollbar {
    display: none;
  }

  .doc-nav ul {
    flex-direction: row;
    gap: 8px;
    width: max-content;
    padding-inline: var(--gutter);
  }

  .doc-nav a {
    padding: 0 16px;
    border-radius: 999px;
    background: var(--paper-2);
    white-space: nowrap;
  }

  .doc-nav [aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
  }

  .doc-toc {
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .doc-toc summary {
    min-height: 48px;
    font-size: 14px;
  }

  .doc-toc ol {
    margin: 0 0 16px;
  }
}

@media (max-width: 1023px) and (hover: hover) and (pointer: fine) {
  .doc-nav a:not([aria-current]):hover {
    background: #eeedf2;
  }
}

@media print {
  html:has(main[data-page="policy"]) :is(.header, .footer, .fab, .cookie, .bar, .doc-side, .skip),
  html:has(main[data-page="policy"]) .page-head::before {
    display: none;
  }

  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
