/* Long-form legal documents with a stable reading measure and navigation index. */
.legal-page {
    background: #fafaf8;
    color: #171b21;
}

.legal-hero {
    padding: calc(var(--header-height) + 5.5rem) var(--page-gutter) 4rem;
    border-bottom: 1px solid rgba(18, 20, 23, 0.14);
    background:
        linear-gradient(rgba(18, 20, 23, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 20, 23, 0.045) 1px, transparent 1px),
        #eef1f4;
    background-size: 3rem 3rem, 3rem 3rem, auto;
}

.legal-hero__inner,
.legal-layout {
    width: min(100%, 72rem);
    margin: 0 auto;
}

.legal-kicker,
.legal-section__number {
    color: var(--runtime-blue);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: uppercase;
}

.legal-kicker {
    margin: 0 0 0.9rem;
}

.legal-hero h1 {
    max-width: 48rem;
    margin: 0;
    color: #121417;
    font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
    font-size: 3.6rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
}

.legal-hero__summary {
    max-width: 45rem;
    margin: 1.25rem 0 0;
    color: #4e5661;
    font-size: 1.05rem;
    line-height: 1.65;
}

.legal-updated {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    margin: 2rem 0 0;
    color: #343b44;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
}

.legal-updated span {
    color: #717985;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    align-items: start;
    gap: clamp(3rem, 7vw, 6rem);
    padding: 4rem var(--page-gutter) 6rem;
}

.legal-toc {
    position: sticky;
    inset-block-start: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow: auto;
    border-top: 2px solid #171b21;
    border-bottom: 1px solid rgba(18, 20, 23, 0.18);
}

.legal-toc summary {
    padding: 1rem 0 0.85rem;
    color: #171b21;
    cursor: pointer;
    font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.legal-toc nav {
    padding-bottom: 1rem;
}

.legal-toc ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    counter-reset: legal-toc;
    list-style: none;
}

.legal-toc li {
    counter-increment: legal-toc;
}

.legal-toc a {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.42rem 0;
    color: #59616c;
    font-size: 0.78rem;
    line-height: 1.35;
    transition: color 150ms ease;
}

.legal-toc a::before {
    color: #8a929c;
    content: counter(legal-toc, decimal-leading-zero);
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.67rem;
}

.legal-toc a[data-section]::before {
    content: attr(data-section);
}

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

.legal-document {
    width: min(100%, 49rem);
}

.legal-section {
    padding: 0 0 3.5rem;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

.legal-section + .legal-section {
    padding-top: 3.5rem;
    border-top: 1px solid rgba(18, 20, 23, 0.13);
}

.legal-section__number {
    margin: 0 0 0.7rem;
}

.legal-section h2 {
    margin: 0 0 1.35rem;
    color: #171b21;
    font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
}

.legal-section p,
.legal-section li {
    color: #414954;
    font-size: 0.98rem;
    line-height: 1.75;
}

.legal-section p {
    margin: 0;
}

.legal-section p + p,
.legal-section ul + p,
.legal-section .legal-table-wrap + p,
.legal-section .legal-contact + p {
    margin-top: 1.15rem;
}

.legal-section ul {
    display: grid;
    gap: 0.48rem;
    margin: 1rem 0 1.2rem;
    padding-left: 1.25rem;
}

.legal-section li::marker {
    color: var(--runtime-blue);
}

.legal-section a {
    color: #174fc8;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
    overflow-wrap: anywhere;
}

.legal-section strong {
    color: #20262d;
}

.legal-contact {
    margin: 1.35rem 0 0;
    padding: 0.25rem 0 0.25rem 1.2rem;
    border-left: 3px solid var(--runtime-blue);
    font-style: normal;
}

.legal-contact p {
    margin: 0;
}

.legal-contact p + p {
    margin-top: 0.35rem;
}

.legal-note {
    margin-top: 1.3rem !important;
    padding: 1rem 1.1rem;
    border-left: 3px solid #376fef;
    background: #eef3ff;
}

.legal-table-wrap {
    margin: 1.4rem 0;
    overflow-x: auto;
    border-top: 2px solid #171b21;
    border-bottom: 1px solid rgba(18, 20, 23, 0.22);
}

.legal-table-wrap:focus-visible {
    outline: 3px solid rgba(47, 107, 255, 0.35);
    outline-offset: 3px;
}

.legal-table-wrap table {
    width: 100%;
    min-width: 46rem;
    border-collapse: collapse;
    text-align: left;
}

.legal-table-wrap th,
.legal-table-wrap td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid rgba(18, 20, 23, 0.12);
    vertical-align: top;
}

.legal-table-wrap th {
    background: #eef1f4;
    color: #20262d;
    font-size: 0.76rem;
    line-height: 1.35;
    text-transform: uppercase;
}

.legal-table-wrap td {
    color: #4a525d;
    font-size: 0.83rem;
    line-height: 1.5;
}

.legal-table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.legal-section--contact {
    padding-bottom: 0;
}

@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .legal-toc {
        position: static;
        max-height: none;
    }

    .legal-toc ol {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 1.5rem;
    }

    .legal-document {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .legal-hero {
        padding-block: calc(var(--header-height) + 3.5rem) 3rem;
    }

    .legal-hero h1 {
        font-size: 2.5rem;
    }

    .legal-layout {
        gap: 2.5rem;
        padding-block: 2.75rem 4rem;
    }

    .legal-toc ol {
        grid-template-columns: 1fr;
    }

    .legal-section {
        padding-bottom: 2.75rem;
    }

    .legal-section + .legal-section {
        padding-top: 2.75rem;
    }

    .legal-section h2 {
        font-size: 1.55rem;
    }

    .legal-section p,
    .legal-section li {
        font-size: 0.94rem;
    }
}

@media print {
    .site-header,
    .site-footer,
    .skip-link,
    .legal-toc {
        display: none !important;
    }

    .main-content {
        margin-top: 0;
    }

    .legal-hero {
        padding: 0 0 2rem;
        background: #fff;
    }

    .legal-layout {
        display: block;
        width: 100%;
        padding: 2rem 0 0;
    }

    .legal-document {
        width: 100%;
        max-width: none;
    }

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

    .legal-section a {
        color: inherit;
    }
}
