/* A narrower, centred page: contents list + a comfortable reading width */
.doc-page {
    --max: 68rem;
    padding-top: clamp(1.75rem, 4vw, 3rem);
}

.back-link:hover .arrow {
    transform: translateX(-3px);
}

.doc-layout {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 2.5rem);
    align-items: start;
    margin-top: 1.5rem;
}

/* Table of contents */

.doc-toc {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    max-height: calc(100vh - var(--header-h) - 3rem);
    overflow-y: auto;
    padding: 0.5rem;
    border-radius: var(--r-md);
    background: var(--surface);
}

.doc-toc summary {
    padding: 0.6rem 0.75rem;
    list-style: none;
    font-weight: 700;
    color: var(--text-soft);
    cursor: pointer;
}

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

.toc-list {
    list-style: none;
}

.toc-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--r-xs);
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-list a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.toc-list a:focus-visible {
    outline-offset: -3px;
}

/* The policy itself, in a rounded reading panel */

.doc {
    max-width: 50rem;
    padding: clamp(1.5rem, 4.5vw, 3.25rem);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: #d6d9df;
    line-height: 1.7;
    overflow-wrap: break-word;
}

.doc h1 {
    color: var(--text);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

.doc h1 + p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-soft);
}

.doc h3 {
    margin: 2.25rem 0 0.7rem;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
}

.doc p,
.doc ul {
    margin-bottom: 1rem;
}

.doc ul {
    padding-left: 1.25rem;
}

.doc li {
    margin-bottom: 0.6rem;
}

.doc strong {
    color: var(--text);
}

.doc .policy-error {
    margin-top: 0;
    color: var(--danger);
}

@media (max-width: 1000px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }

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

    .doc-toc summary::after {
        content: " +";
    }

    .doc-toc[open] summary::after {
        content: " −";
    }
}

@media (min-width: 1001px) {
    .doc-toc summary {
        pointer-events: none;
    }
}
