/* RepeatBox legal / policy pages. */
.legal-site {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-x: clip;
    flex-direction: column;
    background:
        radial-gradient(circle at 8% 3%, rgba(85, 163, 255, 0.11), transparent 27rem),
        var(--rb-surface, #fff);
    color: var(--rb-on-surface, #1a1c1e);
    font-family: var(--rb-font-sans, sans-serif);
    line-height: 1.9;
}

.legal-site *,
.legal-site *::before,
.legal-site *::after {
    box-sizing: border-box;
}

.legal-skip-link {
    position: fixed;
    top: -80px;
    left: 16px;
    z-index: 100;
    border-radius: 999px;
    background: var(--rb-ink, #172033);
    color: #fff;
    padding: 10px 18px;
    text-decoration: none;
}

.legal-skip-link:focus {
    top: 16px;
}

.legal-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(215, 222, 233, 0.8);
    background: rgba(251, 252, 255, 0.9);
    backdrop-filter: blur(18px);
}

.legal-header-inner {
    display: flex;
    width: min(calc(100% - 40px), var(--rb-content, 1120px));
    min-width: 0;
    min-height: 72px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.legal-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--rb-ink, #172033);
    font-family: var(--rb-font-heading, sans-serif);
    font-size: 1.03rem;
    font-weight: 800;
    text-decoration: none;
}

.legal-brand img {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    box-shadow: 0 8px 18px rgba(23, 105, 212, 0.16);
}

.legal-nav {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 24px;
}

.legal-nav .rb-nav-chip {
    color: var(--rb-primary-deep, #24558f);
}

.legal-nav .rb-nav-chip:hover {
    color: var(--rb-primary-strong, #1769d4);
}

.legal-main {
    width: min(calc(100% - 40px), 820px);
    min-width: 0;
    max-width: 100%;
    flex: 1;
    margin: 0 auto;
    padding: 64px 0 96px;
}

.legal-document {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--rb-outline-variant, #d7dee9);
    border-radius: var(--rb-radius-lg, 24px);
    background: rgba(255, 255, 255, 0.82);
    padding: clamp(30px, 6vw, 64px);
    box-shadow: var(--rb-shadow-1, 0 10px 30px rgba(37, 60, 96, 0.1));
    overflow-wrap: anywhere;
}

.legal-document > *,
.legal-document li,
.legal-document ol,
.legal-document ul {
    min-width: 0;
    max-width: 100%;
}

.legal-document h1 {
    font-size: 1.8rem;
    line-height: 1.4;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--rb-primary, #55a3ff);
}

.legal-document h2,
.legal-document h3,
.legal-document h4,
.legal-document h5 {
    color: var(--rb-on-surface, #1a1c1e);
    margin-top: 2em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.legal-document a {
    color: var(--rb-primary-strong, #1f74e6);
    overflow-wrap: anywhere;
}

.legal-document p {
    margin: 0 0 1em;
}

.legal-document ol,
.legal-document ul {
    padding-left: 1.4em;
}

.legal-document li {
    margin-bottom: 0.4em;
}

.legal-document table {
    display: block;
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 1em 0;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.legal-document th,
.legal-document td {
    border: 1px solid var(--rb-outline, #c3c7cf);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.legal-document th {
    background-color: var(--rb-primary-container-2, #eaf3ff);
}

@media (max-width: 640px) {
    .legal-header-inner {
        width: min(calc(100% - 28px), var(--rb-content, 1120px));
        min-height: 64px;
        gap: 12px;
    }

    .legal-nav {
        gap: 0;
    }

    .legal-main {
        width: min(calc(100% - 24px), 820px);
        padding: 32px 0 64px;
    }

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

    .legal-document ol,
    .legal-document ul {
        padding-left: 1.2em;
    }

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