html {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.vf-legal-page {
  height: auto;
  min-height: 100%;
  overflow: visible;
  background: var(--vf-gallery);
  color: var(--vf-ink);
}

.vf-legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--vf-hairline);
  background: color-mix(in srgb, var(--vf-gallery) 90%, transparent);
  backdrop-filter: var(--vf-blur-header);
}

.vf-legal-header-inner,
.vf-legal-main,
.vf-legal-footer-inner {
  width: min(1120px, calc(100% - (2 * var(--vf-space-gutter))));
  margin-inline: auto;
}

.vf-legal-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vf-space-4);
}

.vf-legal-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--vf-space-3);
  color: var(--vf-ink);
  font-weight: var(--vf-weight-heading);
  text-decoration: none;
}

.vf-legal-brand img {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: var(--vf-radius-card);
}

.vf-legal-header nav,
.vf-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vf-space-4);
}

.vf-legal-header a,
.vf-legal-footer a,
.vf-legal-document a {
  color: var(--vf-go-deep);
  text-underline-offset: 3px;
}

.vf-legal-header nav a,
.vf-legal-footer nav a {
  font-size: var(--vf-text-small);
  font-weight: var(--vf-control-weight);
  text-decoration: none;
}

.vf-legal-header a:hover,
.vf-legal-header a:focus-visible,
.vf-legal-footer a:hover,
.vf-legal-footer a:focus-visible,
.vf-legal-document a:hover,
.vf-legal-document a:focus-visible {
  color: var(--vf-ink);
  text-decoration: underline;
}

.vf-legal-header a:focus-visible,
.vf-legal-footer a:focus-visible,
.vf-legal-document a:focus-visible,
.vf-legal-toc a:focus-visible {
  outline: 2px solid var(--vf-focus);
  outline-offset: 4px;
  border-radius: var(--vf-radius-tiny);
}

.vf-legal-main {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 720px);
  justify-content: space-between;
  gap: clamp(var(--vf-space-7), 8vw, 96px);
  padding-block: clamp(var(--vf-space-8), 8vw, 88px);
}

.vf-legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-left: var(--vf-space-5);
}

.vf-legal-toc::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  border-radius: var(--vf-radius-full);
  background: linear-gradient(180deg, var(--vf-go), var(--vf-go-wash));
}

.vf-legal-toc strong {
  display: block;
  margin-bottom: var(--vf-space-3);
  color: var(--vf-carbon);
  font-size: var(--vf-text-label);
  font-weight: var(--vf-weight-selected);
}

.vf-legal-toc ol {
  display: grid;
  gap: var(--vf-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vf-legal-toc a {
  display: block;
  padding-block: var(--vf-space-1);
  color: var(--vf-slate);
  font-size: var(--vf-text-small);
  line-height: 1.35;
  text-decoration: none;
}

.vf-legal-toc a:hover,
.vf-legal-toc a:focus-visible {
  color: var(--vf-ink);
}

.vf-legal-document {
  min-width: 0;
}

.vf-legal-eyebrow {
  margin: 0 0 var(--vf-space-3);
  color: var(--vf-go-deep);
  font-size: var(--vf-text-label);
  font-weight: var(--vf-weight-selected);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vf-legal-document h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--vf-ink);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: var(--vf-weight-heading);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.vf-legal-summary {
  max-width: 58ch;
  margin: var(--vf-space-5) 0 0;
  color: var(--vf-carbon);
  font-size: var(--vf-text-emphasis);
  line-height: 1.55;
}

.vf-legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2) var(--vf-space-5);
  margin: var(--vf-space-6) 0 0;
  padding: 0;
  color: var(--vf-slate);
  font-size: var(--vf-text-small);
  list-style: none;
}

.vf-legal-note {
  margin-top: var(--vf-space-7);
  padding: var(--vf-space-5);
  border-left: 3px solid var(--vf-go);
  border-radius: 0 var(--vf-radius-card) var(--vf-radius-card) 0;
  background: var(--vf-go-wash);
  color: var(--vf-carbon);
}

.vf-legal-note strong {
  display: block;
  margin-bottom: var(--vf-space-1);
  color: var(--vf-ink);
}

.vf-legal-section {
  padding-top: var(--vf-space-9);
  scroll-margin-top: 88px;
}

.vf-legal-section h2 {
  margin: 0 0 var(--vf-space-4);
  color: var(--vf-ink);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: var(--vf-weight-heading);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.vf-legal-section h3 {
  margin: var(--vf-space-6) 0 var(--vf-space-3);
  color: var(--vf-carbon);
  font-size: var(--vf-text-emphasis);
  font-weight: var(--vf-weight-selected);
}

.vf-legal-section p,
.vf-legal-section li {
  color: var(--vf-carbon);
  font-size: var(--vf-text-reading);
  line-height: 1.75;
}

.vf-legal-section p {
  margin: 0 0 var(--vf-space-4);
}

.vf-legal-section ul,
.vf-legal-section ol {
  display: grid;
  gap: var(--vf-space-2);
  margin: 0 0 var(--vf-space-5);
  padding-left: var(--vf-space-6);
}

.vf-legal-section li::marker {
  color: var(--vf-go-deep);
}

.vf-legal-section address {
  color: var(--vf-carbon);
  font-size: var(--vf-text-reading);
  font-style: normal;
  line-height: 1.75;
}

.vf-legal-footer {
  border-top: 1px solid var(--vf-hairline);
  background: var(--vf-paper);
}

.vf-legal-footer-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vf-space-5);
  color: var(--vf-slate);
  font-size: var(--vf-text-small);
}

/* Product page only (Public Information Surface Polish v1 + Public Product
   and Compliance Visual Hierarchy Polish v1). Product's contents nav
   (.vf-legal-toc) lives nested inside .vf-legal-document, right after the
   hero (eyebrow/H1/summary/note, grouped in one .vf-product-hero wrapper)
   and before #overview, so mobile shows it in true reading order without a
   second nav element. Privacy and Terms keep .vf-legal-toc as a direct
   .vf-legal-main sibling (the shared rules above) and are untouched by this
   block. Desktop still visually places the nav in a left column via an
   internal grid on .vf-legal-document itself.

   The hero MUST stay one single wrapped grid item, not four separate
   eyebrow/h1/summary/note items: .vf-legal-toc spans grid-row 1 / -1 to
   stay top-aligned with the hero and run the full height of the content
   column, and a CSS grid distributes a multi-row-spanning item's own
   minimum height across whichever tracks it spans. With four tiny
   individual rows for eyebrow/h1/summary/note, that inflated the eyebrow's
   own row far past its actual text height, producing a large visual gap
   before the H1 -- confirmed by measuring computed grid-template-rows
   directly against a live render. One wrapped hero row removes the small
   individual tracks the toc's span could inflate. */
.vf-product-page .vf-legal-main {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 761px) {
  /* Desktop-only, per the spec's own Desktop Layout section -- mobile keeps
     the shared .vf-legal-main padding-block (Mobile Layout only asks for no
     excessive top spacing, already satisfied by the existing value). */
  .vf-product-page .vf-legal-main {
    padding-block-start: clamp(var(--vf-space-9), 5vw, 56px);
  }

  .vf-product-page .vf-legal-document {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 720px);
    column-gap: clamp(var(--vf-space-7), 8vw, 96px);
  }

  .vf-product-page .vf-legal-document > .vf-legal-toc {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .vf-product-page .vf-legal-document > :not(.vf-legal-toc) {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .vf-legal-header-inner,
  .vf-legal-main,
  .vf-legal-footer-inner {
    width: min(100% - (2 * var(--vf-space-4)), 720px);
  }

  .vf-legal-header-inner {
    min-height: 58px;
  }

  .vf-legal-header nav a:not([aria-current="page"]) {
    display: none;
  }

  .vf-legal-main {
    grid-template-columns: 1fr;
    gap: var(--vf-space-7);
    padding-block: var(--vf-space-8);
  }

  .vf-legal-toc {
    position: relative;
    top: auto;
    order: 2;
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
    padding: var(--vf-space-4) var(--vf-space-5);
    border-radius: var(--vf-radius-card);
    background: var(--vf-paper);
  }

  .vf-legal-toc::before {
    inset: 0 auto 0 0;
  }

  .vf-legal-document {
    order: 1;
  }

  .vf-legal-document h1 {
    font-size: clamp(38px, 14vw, 58px);
  }

  .vf-legal-section {
    padding-top: var(--vf-space-8);
  }

  .vf-legal-footer-inner {
    min-height: 112px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media print {
  .vf-legal-header,
  .vf-legal-toc,
  .vf-legal-footer {
    display: none;
  }

  .vf-legal-main {
    display: block;
    width: 100%;
    padding: 0;
  }

  .vf-legal-section {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
