/* Legal pages (/terms, /privacy): same monochrome system as the dashboard, tuned for long reading. */
body.legal { height: auto; min-height: 100%; }
.legal .lg-top, .legal .lg-wrap { position: relative; z-index: 1; }

.lg-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px); background: rgba(0, 0, 0, .6); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lg-top .brand { padding: 0; text-decoration: none; color: var(--text); }
.lg-top nav { display: flex; align-items: center; gap: 22px; }
.lg-top nav a:not(.btn) { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.lg-top nav a:not(.btn):hover, .lg-top nav a.active { color: var(--text); }
.lg-top nav a.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--text); }

.lg-wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; }
.lg-hero { padding: clamp(48px, 9vw, 96px) 0 36px; }
.lg-hero h1 { font-size: clamp(34px, 6vw, 56px); letter-spacing: -.03em; line-height: 1.02; margin: 10px 0 18px; }
.lg-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.lg-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.lg-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 4px; }
.lg-toc ol { list-style: none; margin: 10px 0 18px; padding: 0; border-left: 1px solid var(--line); }
.lg-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.35; }
.lg-toc li a:hover { color: var(--text); }
.lg-toc li a.active { color: var(--text); border-left-color: var(--text); }
.lg-other { font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.lg-other:hover { color: var(--text); }

/* Document typography */
.lg-doc { padding: clamp(22px, 4vw, 44px); font-size: 15px; line-height: 1.72; color: #d9d9d9; }
.lg-doc > :first-child { margin-top: 0; }
.lg-doc .lead { font-size: 17px; line-height: 1.65; color: var(--text); margin: 0 0 24px; }
.lg-doc .tldr { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .025); padding: 18px 22px; margin: 0 0 12px; border-radius: var(--radius); }
.lg-doc .tldr h2 { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; padding: 0; border: 0; }
.lg-doc .tldr ul { margin: 0; padding-left: 18px; }
.lg-doc .tldr li { margin: 4px 0; }
.lg-doc section { scroll-margin-top: 84px; }
.lg-doc h2 { font-size: 21px; letter-spacing: -.01em; color: var(--text); margin: 44px 0 14px; padding-top: 26px; border-top: 1px solid var(--line); line-height: 1.3; }
.lg-doc h3 { font-size: 15.5px; color: var(--text); margin: 26px 0 8px; }
.lg-doc p { margin: 0 0 14px; }
.lg-doc ul, .lg-doc ol { margin: 0 0 14px; padding-left: 22px; }
.lg-doc li { margin: 5px 0; }
.lg-doc li::marker { color: var(--dim); }
.lg-doc strong { color: var(--text); }
.lg-doc a { color: var(--text); text-decoration-color: var(--dim); }
.lg-doc a:hover { text-decoration-color: var(--text); }
.lg-doc code { font-family: var(--mono); font-size: 13px; background: #141414; border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.lg-doc table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 13.5px; line-height: 1.5; display: block; overflow-x: auto; }
.lg-doc th { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.lg-doc td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 140px; }
.lg-doc tr:last-child td { border-bottom: 0; }

.lg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12.5px; }
.lg-foot .legal-links { padding: 0; }

@media (max-width: 900px) {
  .lg-grid { grid-template-columns: 1fr; }
  .lg-toc { position: static; max-height: none; }
  .lg-toc ol { columns: 2; column-gap: 20px; }
}
@media (max-width: 560px) {
  .lg-top nav { gap: 14px; }
  .lg-top nav .btn { display: none; }
  .lg-toc ol { columns: 1; }
}
@media print {
  #bg, .vignette, .lg-top, .lg-toc, .lg-foot .legal-links { display: none !important; }
  body.legal, .lg-doc { background: #fff !important; color: #000 !important; }
  .lg-doc { border: 0 !important; padding: 0 !important; }
  .lg-doc h2, .lg-doc h3, .lg-doc strong, .lg-doc a, .lg-doc .lead, .lg-hero h1 { color: #000 !important; }
  .lg-grid { display: block; }
}
