.tsm-legal-page {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
}

.tsm-legal-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.tsm-legal-breadcrumbs {
    margin-bottom: .35rem;
    color: #7f8a9c;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tsm-legal-heading h1 {
    margin: 0;
    color: #172033;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.tsm-legal-heading p {
    margin: .45rem 0 0;
    color: #657087;
    font-size: .88rem;
}

.tsm-legal-download {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .7rem 1rem;
    color: #fff !important;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: .65rem;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
    font-size: .76rem;
    font-weight: 700;
}

.tsm-legal-download:hover,
.tsm-legal-download:focus {
    color: #fff !important;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.tsm-legal-card {
    overflow: visible;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .06);
}

.tsm-legal-cover {
    padding: 2.25rem 2.5rem;
    color: #fff;
    background: linear-gradient(135deg, #183462 0%, #255fce 66%, #237d91 125%);
    border-radius: 1rem 1rem 0 0;
}

.tsm-legal-kicker {
    display: inline-flex;
    margin-bottom: .9rem;
    padding: .35rem .6rem;
    color: #eaf2ff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.tsm-legal-cover h2 {
    max-width: 850px;
    margin: 0;
    color: #fff;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.3;
}

.tsm-legal-cover p {
    max-width: 850px;
    margin: .8rem 0 0;
    color: rgba(255, 255, 255, .82);
    font-size: .83rem;
    line-height: 1.6;
}

.tsm-legal-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tsm-legal-meta > div {
    display: flex;
    min-height: 5.2rem;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-right: 1px solid #e2e8f0;
}

.tsm-legal-meta > div:last-child {
    border-right: 0;
}

.tsm-legal-meta span {
    margin-bottom: .25rem;
    color: #7f8a9c;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tsm-legal-meta strong {
    color: #263248;
    font-size: .82rem;
    font-weight: 700;
}

.tsm-legal-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2.5rem;
    padding: 2.25rem 2.5rem 3rem;
}

.tsm-legal-toc-inner {
    position: sticky;
    top: 122px;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
}

.tsm-legal-toc-title {
    margin-bottom: .65rem;
    color: #172033;
    font-size: .74rem;
    font-weight: 700;
}

.tsm-legal-toc a {
    display: block;
    margin: 0 -.45rem;
    padding: .55rem .45rem;
    color: #657087;
    border-radius: .45rem;
    font-size: .72rem;
    line-height: 1.35;
}

.tsm-legal-toc a:hover,
.tsm-legal-toc a:focus {
    color: #1d4ed8;
    background: #eff6ff;
}

.tsm-offer-document,
.tsm-legal-document {
    width: 100%;
    min-width: 0;
    max-width: 940px;
}

.tsm-legal-toc,
.tsm-legal-toc-inner {
    min-width: 0;
}

.tsm-offer-section {
    padding-bottom: 1.3rem;
    scroll-margin-top: 120px;
}

.tsm-offer-section + .tsm-offer-section {
    padding-top: 1.5rem;
    border-top: 1px solid #e8edf4;
}

.tsm-offer-section h2 {
    margin: 0 0 1rem;
    color: #172033;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
}

.tsm-offer-paragraph {
    margin: 0 0 .9rem;
    color: #3f4b61;
    font-size: .79rem;
    line-height: 1.72;
    text-align: left;
    text-transform: none !important;
}

.tsm-offer-paragraph strong {
    color: #1e4f9a;
    font-weight: 700;
}

.tsm-offer-list-item,
.tsm-offer-alpha-item {
    padding: .72rem .85rem;
    background: #f8fafc;
    border-left: 3px solid #c9daf7;
    border-radius: 0 .5rem .5rem 0;
}

.tsm-legal-prose {
    color: #3f4b61;
    font-size: .79rem;
    line-height: 1.72;
}

.tsm-legal-prose h4 {
    margin: 0 0 1rem;
    color: #172033;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    scroll-margin-top: 120px;
}

.tsm-legal-prose h4:not(:first-child) {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8edf4;
}

.tsm-legal-prose p {
    margin: 0 0 .9rem;
    color: #3f4b61;
    font-size: .79rem;
    line-height: 1.72;
    text-align: left;
    text-transform: none !important;
}

.tsm-legal-prose ol,
.tsm-legal-prose ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tsm-legal-prose ol {
    counter-reset: legal-condition;
}

.tsm-legal-prose ol > li {
    position: relative;
    margin-bottom: .8rem;
    padding: .85rem 1rem .85rem 3rem;
    background: #f8fafc;
    border: 1px solid #e8edf4;
    border-radius: .65rem;
    counter-increment: legal-condition;
}

.tsm-legal-prose ol > li::before {
    position: absolute;
    top: .78rem;
    left: .85rem;
    display: inline-flex;
    width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    background: #eaf2ff;
    border-radius: 50%;
    content: counter(legal-condition);
    font-size: .68rem;
    font-weight: 700;
}

.tsm-legal-prose ul {
    margin: .25rem 0 1rem;
}

.tsm-legal-prose ul > li {
    position: relative;
    margin-bottom: .55rem;
    padding-left: 1.2rem;
}

.tsm-legal-prose ul > li::before {
    position: absolute;
    top: .66rem;
    left: .15rem;
    width: .32rem;
    height: .32rem;
    background: #4f83de;
    border-radius: 50%;
    content: '';
}

.tsm-legal-prose table {
    display: block;
    width: 100% !important;
    margin: .25rem 0 1.25rem;
    overflow-x: auto;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: .65rem;
}

.tsm-legal-prose td {
    min-width: 190px;
    padding: .8rem !important;
    color: #3f4b61;
    background: #fff;
    border-color: #e2e8f0 !important;
    vertical-align: top;
}

.tsm-legal-prose tr:nth-child(odd) td {
    background: #f8fafc;
}

.tsm-legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 2.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 1rem 1rem;
}

.tsm-legal-footer div {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.tsm-legal-footer strong {
    color: #263248;
    font-size: .78rem;
}

.tsm-legal-footer span {
    color: #7f8a9c;
    font-size: .7rem;
}

.tsm-legal-footer a {
    flex: 0 0 auto;
    color: #1d4ed8;
    font-size: .74rem;
    font-weight: 700;
}

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

    .tsm-legal-toc-inner {
        position: static;
    }

    .tsm-legal-toc a {
        display: inline-flex;
        max-width: 100%;
        margin: .15rem .25rem .15rem 0;
        padding: .5rem .6rem;
        background: #fff;
        border: 1px solid #e2e8f0;
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .tsm-legal-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .tsm-legal-heading h1 {
        font-size: 1.55rem;
    }

    .tsm-legal-download {
        width: 100%;
    }

    .tsm-legal-cover,
    .tsm-legal-layout {
        padding: 1.25rem;
    }

    .tsm-legal-cover h2 {
        font-size: 1.25rem;
    }

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

    .tsm-legal-meta > div {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .tsm-legal-meta > div:last-child {
        border-bottom: 0;
    }

    .tsm-legal-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.15rem 1.25rem;
    }
}

@media print {
    .tsm-legal-heading,
    .tsm-legal-toc,
    .tsm-legal-footer,
    .header-navbar,
    .main-menu {
        display: none !important;
    }

    body.tsm-cabinet-v2 {
        padding-top: 0 !important;
        background: #fff;
    }

    .tsm-cabinet-v2 .app-content {
        margin-left: 0 !important;
    }

    .tsm-legal-card {
        border: 0;
        box-shadow: none;
    }
}

/* TSM calculator visual language: legal pages. */
.tsm-legal-v2 .tsm-legal-breadcrumbs,
.tsm-legal-v2 .tsm-legal-heading p,
.tsm-legal-v2 .tsm-legal-meta span,
.tsm-legal-v2 .tsm-legal-footer span {
    color: #717d83;
}

.tsm-legal-v2 .tsm-legal-heading h1,
.tsm-legal-v2 .tsm-legal-cover h2,
.tsm-legal-v2 .tsm-legal-meta strong,
.tsm-legal-v2 .tsm-legal-toc-title,
.tsm-legal-v2 .tsm-offer-section h2,
.tsm-legal-v2 .tsm-legal-prose h4,
.tsm-legal-v2 .tsm-legal-footer strong {
    color: #333;
}

.tsm-legal-v2 .tsm-legal-download {
    color: #fff !important;
    background: #d04444;
    border-color: #d04444;
    border-radius: 0;
    box-shadow: none;
}

.tsm-legal-v2 .tsm-legal-download:hover,
.tsm-legal-v2 .tsm-legal-download:focus {
    background: #ed5454;
    border-color: #ed5454;
}

.tsm-legal-v2 .tsm-legal-card {
    border: 0;
    border-radius: 0;
    box-shadow: 0 10px 60px rgba(0, 0, 0, .08);
}

.tsm-legal-v2 .tsm-legal-cover {
    color: #333;
    background: #fff;
    border-top: 4px solid #d04444;
    border-radius: 0;
}

.tsm-legal-v2 .tsm-legal-cover p {
    color: #717d83;
}

.tsm-legal-v2 .tsm-legal-kicker {
    color: #fff;
    background: #d04444;
    border-color: #d04444;
    border-radius: 0;
}

.tsm-legal-v2 .tsm-legal-meta,
.tsm-legal-v2 .tsm-legal-footer,
.tsm-legal-v2 .tsm-legal-toc-inner,
.tsm-legal-v2 .tsm-offer-list-item,
.tsm-legal-v2 .tsm-offer-alpha-item,
.tsm-legal-v2 .tsm-legal-prose ol > li {
    background: #f8f8f8;
    border-color: #e9e9e9;
    border-radius: 0;
}

.tsm-legal-v2 .tsm-legal-toc a,
.tsm-legal-v2 .tsm-legal-footer a,
.tsm-legal-v2 .tsm-offer-paragraph strong {
    color: #d04444;
}

.tsm-legal-v2 .tsm-legal-toc a:hover,
.tsm-legal-v2 .tsm-legal-toc a:focus {
    color: #333;
    background: #fff;
    box-shadow: inset 3px 0 #d04444;
}

.tsm-legal-v2 .tsm-offer-paragraph,
.tsm-legal-v2 .tsm-legal-prose,
.tsm-legal-v2 .tsm-legal-prose p,
.tsm-legal-v2 .tsm-legal-prose td {
    color: #333;
}

.tsm-legal-v2 .tsm-offer-list-item,
.tsm-legal-v2 .tsm-offer-alpha-item {
    border-left-color: #d04444;
}

.tsm-legal-v2 .tsm-legal-prose ol > li::before {
    color: #fff;
    background: #d04444;
    border-radius: 0;
}

.tsm-legal-v2 .tsm-legal-prose ul > li::before {
    background: #d04444;
    border-radius: 0;
}

.tsm-legal-v2 .tsm-legal-prose table {
    border-color: #e9e9e9;
    border-radius: 0;
}

.tsm-legal-v2 :focus-visible {
    outline: 2px solid #333 !important;
    outline-offset: 2px;
}
