/* TaxReady legal pages (privacy, terms, cookies) - layout only; tokens and components come from base.css (docs/DESIGN-SYSTEM.md). */
:target { scroll-margin-top: var(--sp-5); }

.legal { padding-block: var(--sp-6) var(--sp-8); }
.legal-head { max-width: 72ch; margin-bottom: var(--sp-6); }
.legal-head > * + * { margin-top: var(--sp-3); }
.legal-head .lead { max-width: 60ch; }
@media (min-width: 720px) { .legal { padding-block: var(--sp-8) var(--sp-9); } }

.legal-grid { display: grid; gap: var(--sp-6); }

/* ---- table of contents ---- */
.toc { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); }
.toc-title { margin: 0 0 var(--sp-2); font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--c-muted); }
.toc ol { margin: 0; padding-left: 1.5em; }
.toc li { padding-left: .15em; }
.toc li::marker { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text); font-weight: 500; text-decoration: none; }
.toc a:hover { color: var(--c-link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
@media (min-width: 1024px) {
  .legal-grid { grid-template-columns: 260px minmax(0, 72ch); gap: var(--sp-8); align-items: start; }
  .toc { position: sticky; top: var(--sp-5); max-height: calc(100vh - 2 * var(--sp-5)); overflow-y: auto; padding: var(--sp-4); }
  .toc a { min-height: 36px; font-size: var(--fs-small); line-height: 1.3; padding-block: 4px; }
}

/* ---- body ---- */
.legal-body { max-width: 72ch; min-width: 0; counter-reset: sec; }
.legal-sec { counter-increment: sec; }
.legal-sec + .legal-sec { margin-top: var(--sp-7); padding-top: var(--sp-6); border-top: 1px solid var(--c-line); }
.legal-sec > * + * { margin-top: var(--sp-4); }
.legal-sec > h2 { margin-bottom: 0; }
.legal-sec > * + h3 { margin-top: var(--sp-5); }
.sec-h::before { content: counter(sec) ".\00a0"; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.legal-sec ul { padding-left: 1.25em; }
.legal-sec li + li { margin-top: var(--sp-2); }
.legal-sec code { font-size: .92em; padding: 1px 5px; border-radius: var(--r-sm); background: var(--c-surface-2); overflow-wrap: anywhere; }
.legal-note .alert-title { font-size: var(--fs-body); }
.legal-note ul { padding-left: 1.1em; }

/* owner placeholders stay clearly visible until filled in */
mark.ph { background: var(--c-warning-bg); color: var(--c-warning-ink); border: 1px dashed var(--c-warning-ink); border-radius: var(--r-sm); padding: 0 .3em; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); }
.table-wrap:focus-visible { outline-offset: 0; }
.legal-table { width: 100%; min-width: 34rem; font-size: var(--fs-small); line-height: 1.5; }
.legal-table-kv { min-width: 0; }
.legal-table caption { padding: var(--sp-3) var(--sp-4); text-align: left; font-weight: 700; font-size: var(--fs-body); border-bottom: 1px solid var(--c-line); background: var(--c-surface-2); }
.legal-table th, .legal-table td { padding: var(--sp-3) var(--sp-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-line); overflow-wrap: break-word; }
.legal-table thead th { font-weight: 700; color: var(--c-muted); font-size: var(--fs-eyebrow); background: var(--c-surface); }
.legal-table tbody th { font-weight: 600; width: 28%; }
.legal-table tbody tr:last-child > * { border-bottom: 0; }
@media (min-width: 720px) { .legal-table th, .legal-table td { padding: var(--sp-3) var(--sp-4); } }

/* ---- footer: 6 links in two columns ---- */
@media (min-width: 480px) { .site-footer .footer-links { columns: 2; column-gap: var(--sp-6); } .site-footer .footer-links li { break-inside: avoid; } }

@media print { .toc, .site-header, .site-footer { display: none; } .legal-grid { display: block; } }
