/* Legal pages: same tokens as the landing page; a reading column with a section index beside it. */
:root {
  color-scheme: dark;
  --bg: #111419;
  --surface: #181c23;
  --raised: #20252d;
  --line: #2b313b;
  --line-strong: #3d4450;
  --text: #e9ecf1;
  --muted: #a3abb7;
  --subtle: #808995;
  --accent: #4b9af2;
  --accent-soft: rgba(75, 154, 242, .14);
  --warning: #edbd62;
  --warning-bg: #30291d;
  --font-display: "Geist", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f5f8; --surface: #ffffff; --raised: #eef1f5; --line: #dadee5; --line-strong: #bcc3cd;
    --text: #1c222b; --muted: #545d6a; --subtle: #69717d;
    --accent: #146bd0; --accent-soft: rgba(20, 107, 208, .09);
    --warning: #825400; --warning-bg: #fff4d9;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8; --surface: #ffffff; --raised: #eef1f5; --line: #dadee5; --line-strong: #bcc3cd;
  --text: #1c222b; --muted: #545d6a; --subtle: #69717d;
  --accent: #146bd0; --accent-soft: rgba(20, 107, 208, .09);
  --warning: #825400; --warning-bg: #fff4d9;
}

* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; }
.brand svg { color: var(--accent); }
.legal-nav { display: flex; gap: 6px; font-size: .92rem; }
.legal-nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Page */
.page { display: grid; gap: 32px; padding-block: 56px 96px; }
@media (min-width: 960px) { .page { grid-template-columns: 220px minmax(0, 1fr); gap: 72px; } }
.page-head { grid-column: 1 / -1; max-width: 46rem; }
.eyebrow { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
h1 { font-family: var(--font-display); font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 600; line-height: 1.02; letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.updated { font-family: var(--font-mono); font-size: .82rem; color: var(--subtle); margin: 0; }
.draft { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding: 12px 16px; border-radius: 10px; background: var(--warning-bg); color: var(--warning); font-size: .9rem; }

/* Section index */
.toc { font-size: .9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--text); border-color: var(--line-strong); }
.toc summary { cursor: pointer; font-weight: 600; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.toc details[open] summary { margin-bottom: 12px; }
@media (min-width: 960px) {
  .toc { position: sticky; top: calc(24px + env(safe-area-inset-top, 0px)); align-self: start; }
  .toc summary { display: none; }
}

/* Article */
article { max-width: 42rem; min-width: 0; }
article > section + section { margin-top: 48px; }
h2 { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 14px; scroll-margin-top: 24px; text-wrap: balance; }
h2 .n { font-family: var(--font-mono); font-size: .8rem; font-weight: 500; color: var(--subtle); margin-right: 10px; vertical-align: 3px; }
article p { margin: 0 0 14px; }
article ul { margin: 0 0 14px; padding-left: 1.2em; display: grid; gap: 6px; }
article li::marker { color: var(--subtle); }
article strong { font-weight: 600; }
.lead { font-size: 1.12rem; color: var(--muted); }
.todo { background: var(--warning-bg); color: var(--warning); padding: 0 4px; border-radius: 4px; font-family: var(--font-mono); font-size: .85em; }
.table-wrap { overflow-x: auto; margin: 4px 0 18px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-weight: 600; color: var(--muted); font-size: .8rem; }
tr:last-child td { border-bottom: 0; }
.contact { margin-top: 48px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .95rem; }
.contact p { margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 28px; font-size: .86rem; color: var(--subtle); }
footer nav { display: flex; gap: 22px; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--text); }
.foot-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.made { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.made svg { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
