.legal {
    width: min(680px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: #1a1d24;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}

.legal::backdrop {
    background: rgba(15, 20, 35, .55);
}

.legal-box {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.legal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e6e9ef;
}

.legal-head h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.legal-close {
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: #f0f2f6;
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.legal-close:hover {
    background: #e2e6ee;
}

.legal-body {
    overflow-y: auto;
    padding: 4px 20px 16px;
    font-size: .8rem;
    line-height: 1.5;
    color: #3a404c;
    overscroll-behavior: contain;
}

.legal-sec {
    padding: 12px 0 2px;
}

.legal-sec h3 {
    margin: 0 0 4px;
    font-size: .9rem;
    color: #1a1d24;
}

.legal-sec p {
    margin: 0 0 8px;
}

.legal-sec b {
    color: #1a1d24;
}

.legal-date {
    margin: 8px 0 0;
    font-size: .75rem;
    color: #8a909c;
}

body.legal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .legal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .legal-box {
        max-height: 100vh;
    }

    .legal-head,
    .legal-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}