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

:root {
    --z-bg: #FAFAFA;
    --z-surface: #FFFFFF;
    --z-surface2: #EDF2F5;
    --z-stroke: #D6DEE3;
    --z-stroke-soft: rgba(214, 222, 227, 0.55);
    --z-text: #111715;
    --z-text2: #5B6570;
    --z-text3: #8A949D;
    --z-on-primary: #FFFFFF;
    --z-primary: #1B485E;
    --z-primary-deep: #123646;
    --z-primary-light: #C7D6DE;
    --z-cta: linear-gradient(90deg, #123646 0%, #1B485E 50%, #123646 100%);
    --z-shadow-button: 0 10px 24px rgba(18, 54, 70, 0.18);
    --z-shadow-float: 0 12px 28px rgba(17, 23, 21, 0.10);
    --z-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, Arial, sans-serif;
    --z-r-input: 14px;
    --z-r-card: 18px;
    --z-r-button: 18px;
    --z-r-pill: 999px;
    --z-s-xs: 8px;
    --z-s-sm: 12px;
    --z-s-md: 16px;
    --z-s-lg: 24px;
    --z-s-xl: 32px;
    --z-s-xxl: 40px;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body.legal-page {
    background: var(--z-bg);
    color: var(--z-text);
    font-family: var(--z-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.legal-page--rtl {
    direction: rtl;
}

.legal-topbar {
    border-bottom: 1px solid var(--z-stroke);
    background: rgba(250, 250, 250, 0.82);
    backdrop-filter: saturate(1.2) blur(12px);
    -webkit-backdrop-filter: saturate(1.2) blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.legal-topbar-inner {
    width: min(720px, calc(100% - 40px));
    margin: 0 auto;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--z-text);
    text-decoration: none;
    transition: color 180ms ease, opacity 180ms ease;
}

.legal-brand:hover {
    color: var(--z-primary);
}

.legal-brand-mark {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-color: currentColor;
    -webkit-mask: url('/public-pages/brand.svg') no-repeat center / contain;
    mask: url('/public-pages/brand.svg') no-repeat center / contain;
}

.legal-brand-word {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1;
}

.legal-footer-mark {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    opacity: 0.75;
    -webkit-mask: url('/public-pages/brand.svg') no-repeat center / contain;
    mask: url('/public-pages/brand.svg') no-repeat center / contain;
    vertical-align: middle;
}

.legal-back {
    color: var(--z-text2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 180ms ease;
}

.legal-back:hover {
    color: var(--z-text);
}

.legal-back-arrow {
    display: inline-block;
    line-height: 1;
}

.legal-page--rtl .legal-back-arrow {
    transform: scaleX(-1);
}

.legal-shell {
    width: min(680px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 96px;
    animation: legal-fade-up 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.legal-header {
    margin-bottom: var(--z-s-xl);
    text-align: center;
}

.legal-kicker {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--z-text3);
}

.legal-title {
    margin: 0;
    font-size: clamp(30px, 5.6vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--z-text);
}

.legal-meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    margin-top: 18px;
    color: var(--z-text3);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.legal-meta {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.legal-meta + .legal-meta::before {
    content: "·";
    margin: 0 10px 0 0;
    color: var(--z-text3);
}

.legal-page--rtl .legal-meta + .legal-meta::before {
    margin: 0 0 0 10px;
}

.legal-divider {
    height: 1px;
    width: 48px;
    margin: var(--z-s-xl) auto;
    background: var(--z-stroke);
    border: none;
}

.legal-content {
    white-space: pre-wrap;
    line-height: 1.72;
    font-size: 16px;
    color: var(--z-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.legal-content::selection {
    background: rgba(27, 72, 94, 0.14);
}

.legal-footer {
    width: min(680px, calc(100% - 40px));
    margin: 0 auto;
    padding: var(--z-s-lg) 0 var(--z-s-xxl);
    color: var(--z-text3);
    font-size: 12px;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
}

.legal-footer-divider {
    color: var(--z-stroke);
}

@keyframes legal-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Support page ---------- */

.support-lede {
    margin: 18px auto 0;
    max-width: 44ch;
    font-size: 16px;
    line-height: 1.5;
    color: var(--z-text2);
    text-align: center;
}

.support-cta-wrap {
    display: flex;
    justify-content: center;
    margin: var(--z-s-xl) 0 0;
}

.support-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 22px;
    border-radius: var(--z-r-button);
    background: var(--z-cta);
    color: var(--z-on-primary);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.005em;
    text-decoration: none;
    box-shadow: var(--z-shadow-button);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.support-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 30px rgba(18, 54, 70, 0.22);
}

.support-cta:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.support-cta-note {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--z-text3);
}

.support-section {
    margin-top: 56px;
}

.support-section-title {
    margin: 0 0 var(--z-s-lg);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--z-text);
    text-align: center;
}

.support-section-body {
    margin: 0 auto;
    max-width: 52ch;
    font-size: 15px;
    line-height: 1.6;
    color: var(--z-text2);
    text-align: center;
}

.support-topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--z-s-lg);
}

.support-topic {
    text-align: center;
}

.support-topic-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--z-text);
}

.support-topic-body {
    margin: 0 auto;
    max-width: 48ch;
    font-size: 15px;
    line-height: 1.55;
    color: var(--z-text2);
}

.support-links {
    margin-top: 56px;
    text-align: center;
}

.support-links-row {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
}

.support-links-row a {
    color: var(--z-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.005em;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--z-stroke);
    transition: color 180ms ease, border-color 180ms ease;
}

.support-links-row a:hover {
    color: var(--z-primary);
    border-bottom-color: var(--z-primary);
}

/* ---------- Child safety standards page ---------- */

.child-safety-shell {
    width: min(760px, calc(100% - 40px));
}

.child-safety-lede {
    margin: 20px auto 0;
    max-width: 58ch;
    font-size: 17px;
    line-height: 1.6;
    color: var(--z-text2);
    text-align: center;
}

.child-safety-content {
    display: grid;
    gap: 34px;
}

.child-safety-section h2 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--z-text);
}

.child-safety-section p {
    margin: 0;
    font-size: 16px;
    line-height: 1.72;
    color: var(--z-text);
}

.child-safety-section ul {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 10px;
    color: var(--z-text);
    font-size: 16px;
    line-height: 1.62;
}

.child-safety-section a {
    color: var(--z-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--z-primary-light);
}

.child-safety-section a:hover {
    border-bottom-color: var(--z-primary);
}

/* ---------- Delete account page ---------- */

.delete-account-section {
    margin-top: 48px;
}

.delete-account-steps {
    margin: 0 auto;
    padding: 0;
    max-width: 360px;
    list-style: none;
    counter-reset: delete-step;
    display: grid;
    gap: 14px;
}

.delete-account-steps li {
    counter-increment: delete-step;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 14px;
    align-items: center;
    min-height: 48px;
    color: var(--z-text);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
}

.delete-account-steps li::before {
    content: counter(delete-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--z-surface2);
    color: var(--z-primary);
    font-size: 14px;
    font-weight: 700;
}

.delete-account-notice {
    margin: 0 auto var(--z-s-md);
    max-width: 52ch;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.58;
    color: var(--z-text);
    text-align: center;
}

.legal-page--rtl .delete-account-steps li {
    grid-template-columns: 1fr 34px;
}

.legal-page--rtl .delete-account-steps li::before {
    grid-column: 2;
    grid-row: 1;
}

@media (max-width: 640px) {
    .legal-topbar-inner {
        width: min(100% - 28px, 720px);
        height: 52px;
    }

    .legal-shell {
        width: min(100% - 28px, 680px);
        padding: 44px 0 64px;
    }

    .legal-title {
        font-size: clamp(28px, 8.4vw, 34px);
    }

    .legal-content {
        font-size: 15.5px;
        line-height: 1.7;
    }

    .legal-footer {
        width: min(100% - 28px, 680px);
    }

    .support-section {
        margin-top: 44px;
    }

    .support-section-title {
        font-size: 20px;
    }

    .support-links {
        margin-top: 44px;
    }

    .delete-account-section {
        margin-top: 40px;
    }

    .delete-account-steps {
        max-width: 100%;
    }
}
