.terms-of-service-page {
    background: var(--color-paper-white, #f7f7f5);
    color: var(--color-neutral-navy, #102030);
}

.terms-of-service-hero {
    position: relative;
    padding: 56px 0 40px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(29, 118, 112, 0.10), transparent 30%),
        radial-gradient(circle at top right, rgba(241, 178, 70, 0.10), transparent 34%),
        linear-gradient(180deg, #f9f8f3 0%, #f7f7f5 58%, #f4f3ef 100%);
    border-bottom: 1px solid rgba(16, 32, 48, 0.08);
}

.terms-of-service-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.42) 0%,
        rgba(255, 255, 255, 0.18) 24%,
        rgba(255, 255, 255, 0.04) 52%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

.terms-of-service-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 920px;
}

.terms-of-service-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(29, 118, 112, 0.10);
    color: var(--color-guidance-teal, #1d7670);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.terms-of-service-hero__title {
    margin: 0;
    max-width: 16ch;
    color: var(--color-justice-blue, #1f3d63);
    font-size: clamp(2.4rem, 2.05rem + 0.9vw, 3.2rem);
    line-height: 1.12;
    font-weight: 700;
}

.terms-of-service-hero__body {
    margin: 0;
    max-width: 74ch;
    color: rgba(16, 32, 48, 0.82);
    font-size: 1rem;
    line-height: 1.75;
}

.terms-of-service-hero__notice {
    margin-top: 4px;
    max-width: 74ch;
    padding: 16px 18px;
    border: 1px solid rgba(241, 178, 70, 0.32);
    border-radius: 14px;
    background: rgba(241, 178, 70, 0.10);
}

.terms-of-service-hero__notice-text {
    margin: 0;
    color: rgba(16, 32, 48, 0.88);
    font-size: 0.95rem;
    line-height: 1.65;
}

.terms-of-service-content {
    padding: 40px 0 80px;
}

.terms-of-service-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.terms-of-service-toc {
    position: sticky;
    top: 112px;
    padding: 20px 18px;
    border: 1px solid rgba(16, 32, 48, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 32, 48, 0.04);
}

.terms-of-service-toc__title {
    margin: 0 0 14px;
    color: var(--color-justice-blue, #1f3d63);
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.terms-of-service-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.terms-of-service-toc__list a {
    color: rgba(16, 32, 48, 0.72);
    font-size: 0.9375rem;
    line-height: 1.5;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.terms-of-service-toc__list a:hover,
.terms-of-service-toc__list a:focus-visible {
    color: var(--color-guidance-teal, #1d7670);
}

.terms-of-service-article {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.terms-of-service-section {
    padding: 28px 32px;
    border: 1px solid rgba(16, 32, 48, 0.08);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(16, 32, 48, 0.04);
    scroll-margin-top: 120px;
}

.terms-of-service-section__title {
    margin: 0 0 14px;
    color: var(--color-justice-blue, #1f3d63);
    font-size: clamp(1.375rem, 1.25rem + 0.35vw, 1.625rem);
    line-height: 1.25;
    font-weight: 700;
}

.terms-of-service-paragraph {
    margin: 0;
    max-width: 72ch;
    color: rgba(16, 32, 48, 0.84);
    font-size: 1rem;
    line-height: 1.8;
}

.terms-of-service-section > .terms-of-service-paragraph + .terms-of-service-paragraph,
.terms-of-service-section > .terms-of-service-callout + .terms-of-service-paragraph,
.terms-of-service-section > .terms-of-service-paragraph + .terms-of-service-callout {
    margin-top: 14px;
}

.terms-of-service-callout {
    margin-top: 16px;
    padding: 18px 18px;
    border-left: 4px solid var(--color-alert-red, #c74242);
    border-radius: 12px;
    background: rgba(199, 66, 66, 0.08);
}

.terms-of-service-callout__title {
    margin: 0 0 8px;
    color: var(--color-justice-blue, #1f3d63);
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.terms-of-service-callout__body {
    margin: 0;
    color: rgba(16, 32, 48, 0.82);
    font-size: 0.95rem;
    line-height: 1.7;
}

@media (min-width: 961px) {
    .terms-of-service-hero {
        padding: 64px 0 48px;
    }

    .terms-of-service-content {
        padding: 48px 0 88px;
    }

    .terms-of-service-layout {
        grid-template-columns: 288px minmax(0, 1fr);
        gap: 32px;
    }

    .terms-of-service-section {
        padding: 30px 34px;
    }
}

@media (max-width: 960px) {
    .terms-of-service-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .terms-of-service-toc {
        position: static;
    }
}

@media (max-width: 640px) {
    .terms-of-service-hero {
        padding: 32px 0 24px;
    }

    .terms-of-service-hero__title {
        max-width: 100%;
        font-size: clamp(2rem, 1.75rem + 1vw, 2.4rem);
    }

    .terms-of-service-content {
        padding: 20px 0 56px;
    }

    .terms-of-service-section {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .terms-of-service-toc {
        padding: 16px;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terms-of-service-toc__list a {
        transition: none;
    }
}