/* Cortexia legal pages (job 776, 2026-11-13).
   Built on the site's committed tokens (/tokens.css, theme-factory pass of 2026-07-20):
   same SF system type, tinted greys, one Apple-blue accent, no web fonts.
   Layout: a 68ch reading column with a sticky "On this page" rail on wide screens. */
@import url("/tokens.css?v=20260731g");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body {
  margin: 0; background: var(--surface-primary); color: var(--text-primary);
  font-family: var(--font-system); font-size: 1rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img { display: block; }
a { color: var(--accent-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid rgba(0, 113, 227, 0.45); outline-offset: 2px; border-radius: 4px; }

.lg-wrap { width: 100%; max-width: var(--wrap-wide); margin-inline: auto; padding-inline: var(--gut); }

.lg-skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.7rem 1rem; background: var(--surface-dark); color: var(--text-inverse); border-radius: var(--radius-sm); }
.lg-skip:focus { top: 1rem; }

/* ---- header ---- */
.lg-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface-secondary); border-bottom: 1px solid var(--hairline);
}
.lg-head-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.lg-brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text-primary); text-decoration: none; }
.lg-brand img { width: 28px; height: 28px; }
.lg-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.lg-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.7rem;
  font-size: 0.875rem; color: var(--text-secondary); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out-quart);
}
.lg-tabs a:hover { color: var(--text-primary); }
.lg-tabs a[aria-current="page"] { color: var(--text-primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }

/* ---- title block ---- */
.lg-main { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem); }
.lg-title { max-width: 68ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.lg-kicker { margin: 0 0 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-deep); }
.lg-title h1 { margin: 0; font-size: clamp(2.25rem, 5.5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.lg-meta { margin-top: 1rem; color: var(--text-secondary); font-size: 0.9rem; }
.lg-meta p { margin: 0; }

/* ---- grid: rail + document ---- */
.lg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 1000px) {
  .lg-grid { grid-template-columns: 15.5rem minmax(0, 68ch); gap: clamp(3rem, 6vw, 6rem); }
}

.lg-toc { align-self: start; font-size: 0.875rem; }
@media (min-width: 1000px) { .lg-toc { position: sticky; top: 6rem; max-height: calc(100vh - 8rem); overflow: auto; } }
@media (max-width: 999px) {
  .lg-toc { padding: 1.1rem 1.25rem; background: var(--surface-secondary); border-radius: var(--radius-md); }
}
@media (min-width: 600px) and (max-width: 999px) { .lg-toc ol { columns: 2; column-gap: 2rem; } .lg-toc li { break-inside: avoid; } }
.lg-toc-h { margin: 0 0 0.5rem; font-weight: 600; color: var(--text-primary); }
.lg-toc ol { list-style: none; margin: 0; padding: 0; }
.lg-toc a {
  display: flex; align-items: center; min-height: 44px; padding-block: 0.25rem;
  color: var(--text-secondary); text-decoration: none; line-height: 1.35;
  transition: color var(--dur-fast) var(--ease-out-quart);
}
.lg-toc a:hover { color: var(--accent-deep); }

/* ---- document ---- */
.lg-doc { max-width: 68ch; font-size: 1.0625rem; }
.lg-doc > :first-child { margin-top: 0; }
.lg-doc h2 {
  margin: 3rem 0 0.9rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light);
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700;
}
.lg-doc h2:first-child { border-top: 0; padding-top: 0; }
.lg-doc h3 { margin: 2rem 0 0.5rem; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.lg-doc p { margin: 0 0 1rem; }
.lg-doc ul, .lg-doc ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.lg-doc li { margin-bottom: 0.45rem; padding-left: 0.2rem; }
.lg-doc li::marker { color: var(--text-secondary); }
.lg-doc strong { font-weight: 600; }
.lg-title h1, .lg-doc h2, .lg-doc h3 { text-wrap: balance; }
.lg-doc p, .lg-doc li, .lg-entity { text-wrap: pretty; }

.lg-table { margin: 1.25rem 0 1.75rem; overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--radius-md); }
.lg-table table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.lg-table th, .lg-table td { padding: 0.75rem 1rem; text-align: left; vertical-align: top; }
.lg-table th { background: var(--surface-secondary); font-weight: 600; white-space: nowrap; }
.lg-table tr + tr td, .lg-table tbody tr:first-child td { border-top: 1px solid var(--hairline); }
@media (max-width: 640px) { .lg-table table { min-width: 34rem; } }

/* ---- footer ---- */
.lg-foot { background: var(--surface-secondary); border-top: 1px solid var(--hairline); padding-block: 2rem 1.5rem; }
.lg-entity { margin: 0 0 0.35rem; max-width: 75ch; color: var(--text-secondary); font-size: 0.8125rem; line-height: 1.6; }
.lg-links { display: flex; flex-wrap: wrap; align-items: center; color: var(--text-secondary); font-size: 0.8125rem; }
.lg-links a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.4rem; color: var(--text-primary); text-decoration-color: var(--border-light); }
.lg-links a:first-child { padding-left: 0; }
.lg-links a:hover { text-decoration-color: currentColor; }

@media (max-width: 720px) {
  .lg-head { position: static; }
  .lg-head-in { flex-direction: column; align-items: flex-start; gap: 0; padding-block: 0.5rem; }
  .lg-tabs { justify-content: flex-start; margin-left: -0.7rem; }
  .lg-tabs a { padding-inline: 0.6rem; }
  html { scroll-padding-top: 1rem; }
}
