/**
 * legal.css - the terms and privacy page.
 *
 * Legal text is only useful if it is actually readable, and most of it is not
 * because it is set at 11px in a scroll box nobody opens. This is set at body
 * size in a proper measure, with real headings and tables, so a person can skim
 * it and find the clause they care about.
 */

/* ── Undo the app shell's scroll lock ─────────────────────────────────────── */
/* style.css and ui.css both set `html, body { height: 100%; overflow: hidden }`,
   which is right for the app (it scrolls inside its own panes) and wrong for a
   plain document page: it clipped everything below the fold with no way to
   reach it. This file loads last, so restoring normal document scrolling here
   is enough. */
html, body {
    height: auto;
    min-height: 100%;
    overflow: visible;
    overscroll-behavior: auto;
}

.legal-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px 80px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.legal-header {
    padding: 28px 0 20px;
    border-bottom: 1px solid var(--border);
}

.legal-back {
    display: inline-block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-3);
    text-decoration: none;
    margin-bottom: 18px;
}
.legal-back:hover { color: var(--text); }

.legal-header h1 {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -.03em;
    margin: 0;
}

.legal-sub {
    font-size: 1rem;
    color: var(--text-2);
    margin: 6px 0 0;
}

.legal-dates {
    font-size: .78rem;
    color: var(--text-3);
    margin: 10px 0 0;
}

/* ── Table of contents ────────────────────────────────────────────────────── */

.legal-toc {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 18px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
    border-bottom: 1px solid var(--border);
}

.legal-toc a {
    font-size: .8rem;
    font-weight: 600;
    padding: 8px 14px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    text-decoration: none;
}
.legal-toc a:hover { background: var(--surface-3); color: var(--text); }

/* ── Callout ──────────────────────────────────────────────────────────────── */

.legal-callout {
    margin: 22px 0 0;
    padding: 14px 16px;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--brand-soft);
}
.legal-callout p { margin: 0; font-size: .88rem; line-height: 1.7; color: var(--text-2); }

/* ── Body copy ────────────────────────────────────────────────────────────── */

.legal-main section { padding-top: 34px; scroll-margin-top: 78px; }

.legal-main h2 {
    font-family: var(--serif);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -.025em;
    margin: 0 0 6px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.legal-main h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 28px 0 8px;
    color: var(--text);
}

.legal-main p,
.legal-main li {
    font-size: .92rem;
    line-height: 1.75;
    color: var(--text-2);
}

.legal-main p { margin: 0 0 12px; }
.legal-main ul { margin: 0 0 14px; padding-left: 22px; }
.legal-main li { margin-bottom: 6px; }
.legal-main b { color: var(--text); font-weight: 650; }
.legal-main a { color: var(--brand); overflow-wrap: anywhere; }

/* Placeholders the operator still has to fill in should be impossible to miss. */
.legal-main b:not(:has(*)) { }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 18px;
    font-size: .84rem;
    display: block;
    overflow-x: auto;
    white-space: normal;
}

.legal-table thead th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-2);
    white-space: nowrap;
}

.legal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    line-height: 1.6;
    vertical-align: top;
    min-width: 130px;
}

.legal-table tbody tr:last-child td { border-bottom: none; }

/* ── Emphasised legal blocks ──────────────────────────────────────────────── */

/* Disclaimers and liability caps are conventionally set apart. Small caps
   rather than shouting capitals: the convention is satisfied and it stays
   readable. */
.legal-caps {
    font-variant: small-caps;
    letter-spacing: .015em;
    background: var(--surface-2);
    padding: 12px 14px;
    border-radius: var(--r-sm);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.legal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-3);
}
.legal-footer a { color: var(--text-3); text-decoration: none; font-weight: 600; }
.legal-footer a:hover { color: var(--text); }

@media (max-width: 560px) {
    .legal-header h1 { font-size: 1.6rem; }
    .legal-main h2 { font-size: 1.35rem; }
    .legal-toc { gap: 6px; }
}
