.legal-page {
    width: min(100% - 2rem, 860px);
    height: var(--app-visible-viewport-height, 100dvh);
    max-height: 100dvh;
    margin: 0 auto;
    min-height: 0;
    box-sizing: border-box;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(3rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-behavior: smooth;
    background: rgba(8, 12, 16, 0.97);
    color: #f4f7f8;
}

.legal-header {
    min-height: 56px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.75rem;
}

.legal-back {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #fff;
    text-decoration: none;
    font: 600 1.5rem/1 system-ui, sans-serif;
}

.legal-logo {
    width: 150px;
    max-height: 52px;
    object-fit: contain;
    justify-self: start;
}

.legal-languages {
    margin: 0;
}

.legal-notice {
    margin: 1.25rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 202, 40, 0.45);
    border-radius: 10px;
    color: #ffe59a;
    background: rgba(255, 202, 40, 0.08);
    font: 0.85rem/1.5 Inter, system-ui, sans-serif;
}

.legal-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 1rem;
    padding: 0.8rem 0;
    background: rgba(7, 10, 13, 0.94);
}

.legal-tabs a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: #80d4a5;
    font: 700 0.8rem/1 Inter, system-ui, sans-serif;
    text-decoration: none;
}

.legal-document section {
    scroll-margin-top: 72px;
    padding: 1.5rem 0 2rem;
}

.legal-document section + section {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-document h1,
.legal-document h2 {
    color: #fff;
    font-family: Inter, system-ui, sans-serif;
    text-wrap: balance;
    font-style: normal;
}

.legal-document h1 {
    margin: 0 0 0.4rem;
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.legal-document h2 {
    margin: 1.6rem 0 0.45rem;
    font-size: 1rem;
}

.legal-document p {
    max-width: 72ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font: 0.95rem/1.7 Inter, system-ui, sans-serif;
    text-wrap: pretty;
}

.legal-document .legal-date {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.82rem;
}

[data-legal-lang] {
    display: none;
}

[data-legal-lang].is-active {
    display: block;
}

@media (max-width: 560px) {
    .legal-page { width: 100%; }
    .legal-header { grid-template-columns: 44px 1fr; }
    .legal-logo { width: 125px; }
    .legal-languages { grid-column: 1 / -1; justify-self: center; }
    .legal-tabs { justify-content: space-around; gap: 0.4rem; }
    .legal-document h1 { font-size: 1.65rem; }
}
