/* ─────────────────────────────────────────────────────────────
   Public legal / static documents (Terms, Privacy).
   Standalone, WebView- and browser-friendly — no app chrome.
   Reuses the design tokens from lex.css (:root). Scoped to .lex-doc.
   ───────────────────────────────────────────────────────────── */

.lex-doc {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ── top bar: brand + language toggle ── */
.lex-doc__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(18px, 5vw, 40px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 10;
}

.lex-doc__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--lex-teal-deep);
    font-family: var(--display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
}

.lex-doc__langs {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-deep);
    padding: 4px;
    border-radius: 999px;
}

.lex-doc__lang {
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink-3);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}

.lex-doc__lang:hover { color: var(--ink); }

.lex-doc__lang.is-active {
    background: var(--surface);
    color: var(--lex-teal-deep);
    box-shadow: var(--shadow-soft);
}

/* ── content column ── */
.lex-doc__wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 52px) clamp(18px, 5vw, 40px) 72px;
}

.lex-doc__paper {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: clamp(26px, 5vw, 56px);
    counter-reset: lex-sec;
}

/* Auto-number sections so the templates never hard-code section numbers. */
.lex-doc__paper h2::before {
    counter-increment: lex-sec;
    content: counter(lex-sec) ". ";
    color: var(--ink-4);
    font-weight: 700;
}

.lex-doc__paper h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 6px;
    color: var(--ink);
}

.lex-doc__paper h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
    margin: 34px 0 10px;
    color: var(--lex-teal-deep);
}

.lex-doc__paper p,
.lex-doc__paper li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-2);
    margin: 0 0 14px;
}

.lex-doc__paper ul {
    margin: 0 0 16px;
    padding-left: 22px;
}

.lex-doc__paper li { margin-bottom: 8px; }

.lex-doc__paper a {
    color: var(--lex-teal);
    font-weight: 600;
    text-underline-offset: 2px;
}

.lex-doc__paper a:hover { color: var(--lex-teal-deep); }

/* "Last updated:" caption — the first paragraph under the title. */
.lex-doc__updated {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-4);
    margin: 0 0 24px;
    letter-spacing: 0.01em;
}

.lex-doc__foot {
    text-align: center;
    color: var(--ink-4);
    font-size: 13px;
    margin-top: 26px;
}

/* Help page: contact card + FAQ accordion. */
.lex-doc__contact {
    background: var(--bg-deep);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    padding: 20px clamp(18px, 4vw, 28px);
    margin: 8px 0 28px;
}

.lex-faq {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 0 18px;
    margin: 0 0 10px;
    background: var(--surface);
}

.lex-faq > summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 28px 16px 0;
    position: relative;
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
}

.lex-faq > summary::-webkit-details-marker { display: none; }

.lex-faq > summary::after {
    content: '+';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink-3);
    line-height: 1;
}

.lex-faq[open] > summary::after { content: '\2212'; /* minus */ }

.lex-faq > p {
    margin: 0;
    padding: 0 0 16px;
    font-size: 15px;
}
