/*
 * The look of Tutoro's legal pages: privacy-policy.html, terms-of-use.html, policy.html and the
 * two account guides. Plain static documents on purpose: they are opened from store listings,
 * from the app's in-app browser sheet and from every site's footer, and must render with no
 * bundle, no API call and no third-party request (so: system fonts, no Google Fonts).
 * Colour values are the web kit's (shared-web/styles/tokens/colors.css), copied, not imported.
 * Concept: System/concepts/legal-documents.yaml
 */
:root {
    --bg: rgb(255, 255, 255);
    --ink: rgb(26, 22, 46);
    --muted: rgb(95, 91, 115);
    --line: rgb(234, 231, 244);
    --accent: rgb(53, 12, 255);
    --link: rgb(83, 54, 218);
    --soft: rgb(246, 244, 255);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: rgb(17, 15, 26);
        --ink: rgb(236, 234, 245);
        --muted: rgb(166, 162, 186);
        --line: rgb(44, 40, 60);
        --accent: rgb(150, 135, 255);
        --link: rgb(170, 158, 255);
        --soft: rgb(28, 25, 42);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-wrap: break-word;
}

.legal {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 72px;
}

.legal-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.legal-top img { display: block; height: 30px; width: auto; }

.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.legal-nav a { color: var(--muted); text-decoration: none; }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { color: var(--link); }

h1 {
    margin: 32px 0 6px;
    font-size: clamp(28px, 6vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h2 {
    margin: 44px 0 10px;
    font-size: 21px;
    line-height: 1.3;
    scroll-margin-top: 16px;
}

h3 { margin: 24px 0 6px; font-size: 17px; line-height: 1.35; }

p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
li > ul { margin-top: 6px; }

a { color: var(--link); text-underline-offset: 2px; }

.meta { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.summary {
    margin: 24px 0 8px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--soft);
}
.summary h2 { margin: 0 0 8px; font-size: 17px; }
.summary ul { margin: 0; }

.toc { margin: 24px 0 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 24px; font-size: 15px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { text-decoration: none; }

/* Two-column facts (provider | what | why). Stacks on a phone instead of scrolling sideways. */
.facts { width: 100%; margin: 8px 0 18px; border-collapse: collapse; font-size: 15px; }
.facts th, .facts td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.facts th { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.facts td:first-child { font-weight: 600; min-width: 150px; }

@media (max-width: 600px) {
    .facts thead { display: none; }
    .facts, .facts tbody, .facts tr, .facts td { display: block; width: 100%; }
    .facts tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .facts td { padding: 2px 0; border: 0; }
    .facts td:first-child { min-width: 0; }
    .facts td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-weight: 600;
    }
}

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; padding-left: 40px; margin-bottom: 12px; counter-increment: step; }
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    line-height: 28px;
    text-align: center;
}

.cards { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.cards a {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
}
.cards a:hover { border-color: var(--link); }
.cards strong { display: block; color: var(--link); font-size: 17px; }
.cards span { color: var(--muted); font-size: 15px; }

.legal-foot {
    margin-top: 56px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}
