/* ---------- Public legal pages (Terms / Privacy / Cookies) ---------- */
.legal-body {
    margin: 0;
    background: #F7F6FB;
    color: #1A1826;
    font-family: 'Figtree', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
}

.legal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(247, 246, 251, 0.86);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid rgba(26, 24, 38, 0.10);
}

.legal-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: #1A1826;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.legal-lang {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    background: #ECEAF4;
    border-radius: 999px;
}
.legal-lang-btn {
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #6A6678;
    padding: 5px 12px;
    border-radius: 999px;
}
.legal-lang-btn.is-active {
    background: #ffffff;
    color: #7C3AED;
    box-shadow: 0 1px 2px rgba(26, 24, 38, 0.10);
}

.legal-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px 24px;
}

.legal-doc[hidden] { display: none; }

.legal-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7C3AED;
    margin: 0 0 10px;
}

.legal-doc h1 {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 8px;
    text-wrap: balance;
}

.legal-updated {
    font-size: 13.5px;
    color: #6A6678;
    margin: 0 0 12px;
}

.legal-doc h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 38px 0 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(26, 24, 38, 0.10);
}

.legal-doc h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 8px;
}

.legal-doc p,
.legal-doc li {
    font-size: 15.5px;
    color: #2C2A3A;
    max-width: 68ch;
}
.legal-doc p { margin: 0 0 14px; }

.legal-doc ul {
    margin: 0 0 16px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.legal-doc li { padding-left: 4px; }
.legal-doc li::marker { color: #A78BE0; }

.legal-doc a {
    color: #7C3AED;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.legal-doc strong { font-weight: 700; color: #1A1826; }

.legal-doc code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: rgba(26, 24, 38, 0.06);
    padding: 1px 6px;
    border-radius: 5px;
}

/* callout for the important scientific / no-warranty notices */
.legal-callout {
    margin: 18px 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(124, 58, 237, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.20);
}
.legal-callout p { margin: 0; }
.legal-callout p + p { margin-top: 10px; }

.legal-note-inline {
    font-size: 13px;
    color: #6A6678;
    margin-top: -6px;
}

.legal-fill {
    background: rgba(217, 119, 6, 0.16);
    color: #92400E;
    padding: 1px 6px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.92em;
    white-space: nowrap;
}

.legal-doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 18px;
    font-size: 14px;
}
.legal-doc th,
.legal-doc td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(26, 24, 38, 0.10);
    vertical-align: top;
}
.legal-doc th {
    font-weight: 700;
    color: #1A1826;
    background: rgba(26, 24, 38, 0.03);
}
.legal-doc td { color: #2C2A3A; }
.legal-table-wrap { overflow-x: auto; }

.legal-footer {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 24px 56px;
    border-top: 1px solid rgba(26, 24, 38, 0.10);
    margin-top: 24px;
}
.legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 12px;
}
.legal-footer-links a {
    font-size: 13.5px;
    font-weight: 600;
    color: #6A6678;
    text-decoration: none;
}
.legal-footer-links a:hover { color: #7C3AED; }
.legal-footer-links a[aria-current="page"] { color: #7C3AED; }
.legal-footer-note { font-size: 12.5px; color: #928EA0; margin: 0; }

/* ---------- Dark mode ---------- */
:root[data-theme="dark"] .legal-body { background: #161619; color: #ECEAF2; }
:root[data-theme="dark"] .legal-topbar {
    background: rgba(22, 22, 25, 0.86);
    border-bottom-color: rgba(255, 255, 255, 0.09);
}
:root[data-theme="dark"] .legal-logo { color: #ECEAF2; }
:root[data-theme="dark"] .legal-lang { background: #2A2A31; }
:root[data-theme="dark"] .legal-lang-btn { color: #A5A1B2; }
:root[data-theme="dark"] .legal-lang-btn.is-active { background: #1E1E22; color: #C4B5FD; }
:root[data-theme="dark"] .legal-updated,
:root[data-theme="dark"] .legal-footer-links a,
:root[data-theme="dark"] .legal-footer-note { color: #A5A1B2; }
:root[data-theme="dark"] .legal-doc h2 { border-top-color: rgba(255, 255, 255, 0.10); }
:root[data-theme="dark"] .legal-doc p,
:root[data-theme="dark"] .legal-doc li,
:root[data-theme="dark"] .legal-doc td { color: #C9C6D6; }
:root[data-theme="dark"] .legal-doc strong,
:root[data-theme="dark"] .legal-doc h1,
:root[data-theme="dark"] .legal-doc h2,
:root[data-theme="dark"] .legal-doc h3,
:root[data-theme="dark"] .legal-doc th { color: #ECEAF2; }
:root[data-theme="dark"] .legal-doc a { color: #C4B5FD; }
:root[data-theme="dark"] .legal-eyebrow { color: #C4B5FD; }
:root[data-theme="dark"] .legal-callout { background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.28); }
:root[data-theme="dark"] .legal-fill { background: rgba(251, 191, 36, 0.18); color: #FCD34D; }
:root[data-theme="dark"] .legal-note-inline { color: #A5A1B2; }
:root[data-theme="dark"] .legal-doc th { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .legal-doc th,
:root[data-theme="dark"] .legal-doc td,
:root[data-theme="dark"] .legal-footer { border-color: rgba(255, 255, 255, 0.10); }
:root[data-theme="dark"] .legal-doc li::marker { color: #8B7BC0; }
:root[data-theme="dark"] .legal-doc code { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 560px) {
    .legal-main { padding: 28px 18px 16px; }
    .legal-topbar { padding: 12px 16px; }
}
