.legal-enhanced {
    background: #f8f5ef;
    color: #0b1728;
    font-family: "Manrope", system-ui, sans-serif;
}

.legal-enhanced .terms-section,
.legal-enhanced .privacy-policy-section,
.legal-enhanced .policy-section {
    background: #f8f5ef;
    padding: 76px 0 104px;
}

.legal-enhanced .terms-container,
.legal-enhanced .privacy-policy-container,
.legal-enhanced .policy-container {
    margin: 0 auto;
    max-width: 1336px;
    padding: 0 52px;
}

.legal-layout {
    align-items: start;
    display: grid;
    gap: clamp(46px, 7vw, 96px);
    grid-template-columns: 240px minmax(0, 820px);
    justify-content: center;
}

.legal-contents {
    position: sticky;
    top: 112px;
}

.legal-contents details {
    background: #fffdf9;
    border: 1px solid #d8ddd8;
    border-radius: 16px;
    padding: 18px;
}

.legal-contents summary {
    color: #0b1728;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    list-style: none;
    text-transform: uppercase;
}

.legal-contents summary::-webkit-details-marker {
    display: none;
}

.legal-contents summary::after {
    color: #08705c;
    content: " +";
    float: right;
}

.legal-contents details[open] summary::after {
    content: " −";
}

.legal-contents nav {
    display: grid;
    gap: 1px;
    margin-top: 14px;
    max-height: min(54vh, 520px);
    overflow-y: auto;
    padding-right: 6px;
}

.legal-contents nav a {
    border-left: 2px solid transparent;
    color: #5a6563;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
    padding: 7px 8px;
    text-decoration: none;
}

.legal-contents nav a:hover,
.legal-contents nav a:focus-visible,
.legal-contents nav a[aria-current="location"] {
    border-left-color: #08705c;
    color: #075846;
}

.legal-tools {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.legal-tools button,
.legal-tools a,
.legal-language-control button {
    background: transparent;
    border: 1px solid #c7d0ca;
    border-radius: 9px;
    color: #075846;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    min-height: 40px;
    padding: 10px 12px;
    text-align: center;
    text-decoration: none;
}

.legal-tools button:hover,
.legal-tools a:hover,
.legal-language-control button:hover,
.legal-language-control button[aria-pressed="true"] {
    background: #eaf5f1;
    border-color: rgba(8, 112, 92, 0.46);
}

.legal-language-control {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.legal-document {
    background: #fffdf9;
    border: 1px solid #d8ddd8;
    border-radius: 22px;
    min-width: 0;
    padding: clamp(34px, 5vw, 68px);
}

.legal-enhanced .legal-document h1,
.legal-enhanced .terms-section h1,
.legal-enhanced .privacy-policy-section h1,
.legal-enhanced .policy-section h1 {
    color: #0b1728;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.04;
    margin: 0;
    max-width: 14ch;
    text-align: left;
}

.legal-enhanced .terms-section .subtitle {
    color: #34413f;
    font-size: 1.2rem;
    margin: 18px 0 0;
    text-align: left;
}

.legal-enhanced .terms-section .effective-date,
.legal-enhanced .privacy-policy-section .last-updated,
.legal-enhanced .policy-meta {
    color: #5a6563;
    font-size: 0.82rem;
    font-weight: 700;
    margin: 12px 0 34px;
    text-align: left;
}

.legal-enhanced .legal-document h2,
.legal-enhanced .terms-section h2,
.legal-enhanced .privacy-policy-section h2,
.legal-enhanced .policy-language h2 {
    border-top: 1px solid #d8ddd8;
    color: #0b1728;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.24;
    margin: 50px 0 18px;
    padding-top: 40px;
    scroll-margin-top: 110px;
}

.legal-enhanced .legal-document h3,
.legal-enhanced .privacy-policy-section h3,
.legal-enhanced .policy-clause h3 {
    color: #0b1728;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.4;
    margin: 28px 0 10px;
}

.legal-enhanced .legal-document p,
.legal-enhanced .legal-document li,
.legal-enhanced .terms-section p,
.legal-enhanced .terms-section .clause-num,
.legal-enhanced .terms-section .clause-text,
.legal-enhanced .terms-section .sub-clause-label,
.legal-enhanced .terms-section .sub-clause-text,
.legal-enhanced .terms-section .roman-label,
.legal-enhanced .terms-section .roman-text,
.legal-enhanced .privacy-policy-section p,
.legal-enhanced .privacy-policy-section li,
.legal-enhanced .policy-intro,
.legal-enhanced .policy-clause p,
.legal-enhanced .policy-links {
    color: #34413f;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 0.94rem;
    line-height: 1.78;
}

.legal-enhanced .section-divider {
    background: #d8ddd8;
    margin: 42px 0;
}

.legal-enhanced .privacy-policy-section .contact-info,
.legal-enhanced .policy-links {
    background: #eaf5f1;
    border: 1px solid rgba(8, 112, 92, 0.18);
    border-radius: 12px;
    padding: 22px;
}

.legal-enhanced .policy-language + .policy-language {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.legal-enhanced .policy-clause {
    margin-bottom: 24px;
}

.legal-back-to-top {
    background: #08705c;
    border-radius: 10px;
    bottom: 18px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 11px 14px;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 18px;
    text-decoration: none;
    transform: translateY(6px);
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 30;
}

.legal-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .legal-enhanced .terms-container,
    .legal-enhanced .privacy-policy-container,
    .legal-enhanced .policy-container {
        padding: 0 28px;
    }

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

    .legal-contents {
        position: static;
    }

    .legal-contents nav {
        max-height: 320px;
    }
}

@media (max-width: 600px) {
    .legal-enhanced .terms-section,
    .legal-enhanced .privacy-policy-section,
    .legal-enhanced .policy-section {
        padding: 48px 0 76px;
    }

    .legal-enhanced .terms-container,
    .legal-enhanced .privacy-policy-container,
    .legal-enhanced .policy-container {
        padding: 0 20px;
    }

    .legal-document {
        border-radius: 16px;
        padding: 30px 20px;
    }

    .legal-enhanced .terms-section .clause {
        gap: 10px;
    }

    .legal-enhanced .terms-section .clause-num {
        width: 32px;
    }

    .legal-enhanced .terms-section .sub-clause {
        gap: 8px;
        margin-left: 8px;
    }

    .legal-enhanced .terms-section .roman-clause {
        gap: 8px;
        margin-left: 14px;
    }

    .legal-back-to-top {
        bottom: 12px;
        right: 12px;
    }
}

@media print {
    .cfm-site-header,
    .legal-contents,
    .legal-back-to-top,
    .cfm-au-footer {
        display: none !important;
    }

    .legal-enhanced .terms-section,
    .legal-enhanced .privacy-policy-section,
    .legal-enhanced .policy-section {
        background: #fff;
        padding: 0;
    }

    .legal-layout {
        display: block;
    }

    .legal-document {
        border: 0;
        padding: 0;
    }
}
