/* XCortex legal pages — a reading document: the app's tokens, a 68ch measure, clear hierarchy, both themes */
:root{
  --bg:#14161b; --surface:#1b1e25; --surface2:#21252e; --line:#2a2f3a;
  --text:#e7e9ee; --muted:#8e94a1; --accent:#7b95ff; --accent-weak:#5b7cfa26;
}
html[data-theme="light"]{
  --bg:#f6f7f9; --surface:#ffffff; --surface2:#eef0f4; --line:#dfe3ea;
  --text:#1f2329; --muted:#5f6571; --accent:#3b5bdb; --accent-weak:#4c6ef518;
}
@media (prefers-color-scheme: light){
  html:not([data-theme="dark"]){
    --bg:#f6f7f9; --surface:#ffffff; --surface2:#eef0f4; --line:#dfe3ea;
    --text:#1f2329; --muted:#5f6571; --accent:#3b5bdb; --accent-weak:#4c6ef518;
  }
}
*{ box-sizing:border-box; }
html{ background:var(--bg); }
body{ margin:0; background:var(--bg); color:var(--text); font:16px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased; }
a{ color:var(--accent); text-underline-offset:2px; }
a:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:3px; }
.lhead{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; max-width:880px; margin:0 auto; padding:18px 24px;
  border-bottom:1px solid var(--line); }
.lbrand{ display:flex; align-items:center; gap:10px; font-weight:700; color:var(--text); text-decoration:none; }
.mark{ display:inline-grid; place-items:center; width:28px; height:28px; border-radius:8px; background:#5b7cfa; color:#fff; font-size:.7rem; letter-spacing:.04em; }
.lnav{ display:flex; gap:18px; font-size:.92rem; }
.lnav a{ color:var(--muted); text-decoration:none; }
.lnav a:hover, .lnav a[aria-current="page"]{ color:var(--text); }
.doc{ max-width:880px; margin:0 auto; padding:34px 24px 64px; }
.doc > *{ max-width:68ch; }
.doc > table, .doc > .tldr, .doc > .toc{ max-width:none; }
h1{ font-size:clamp(1.9rem, 4vw, 2.5rem); line-height:1.15; letter-spacing:-.02em; margin:0 0 6px; text-wrap:balance; }
.meta{ color:var(--muted); font-size:.9rem; margin:0 0 26px; }
h2{ font-size:1.25rem; line-height:1.3; margin:40px 0 10px; letter-spacing:-.01em; text-wrap:balance; scroll-margin-top:16px; }
h3{ font-size:1.02rem; margin:22px 0 6px; }
p, li{ font-size:1rem; }
ul, ol{ padding-left:1.3em; }
li{ margin:5px 0; }
b{ font-weight:650; }
.small{ color:var(--muted); font-size:.88rem; margin:10px 0 0; }
.tldr{ background:var(--surface); border:1px solid var(--line); border-left:4px solid #5b7cfa; border-radius:12px; padding:18px 22px; margin:0 0 26px; }
.tldr h2{ margin:0 0 6px; font-size:1.05rem; }
.tldr ul{ margin:0; }
.toc{ border:1px solid var(--line); border-radius:12px; padding:16px 22px; margin:0 0 10px; }
.toc h2{ margin:0 0 6px; font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.toc ol{ columns:2; column-gap:32px; margin:0; font-size:.94rem; }
.toc li{ margin:3px 0; break-inside:avoid; }
table{ width:100%; border-collapse:collapse; margin:12px 0 8px; font-size:.93rem; }
th{ text-align:left; color:var(--muted); font-weight:650; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; padding:8px 12px 8px 0;
  border-bottom:1px solid var(--line); vertical-align:bottom; }
td{ padding:9px 12px 9px 0; border-bottom:1px solid var(--line); vertical-align:top; line-height:1.5; }
td:first-child{ font-weight:600; min-width:9em; }
.lfoot{ max-width:880px; margin:0 auto; padding:20px 24px 36px; border-top:1px solid var(--line); color:var(--muted); font-size:.88rem; }
@media (max-width:640px){
  .lhead{ padding:14px 16px; } .doc{ padding:24px 16px 48px; } .lfoot{ padding:18px 16px 30px; }
  .toc ol{ columns:1; } td:first-child{ min-width:7em; }
  .doc table{ display:block; overflow-x:auto; }   /* wide tables scroll inside themselves, never the page */
}
@media print{ .lhead, .lfoot, .toc{ display:none; } body{ background:#fff; color:#000; } a{ color:#000; } }
