/* Legal pages (Terms, Privacy, Refunds), v2 vocabulary. Needs v2 tokens + type scale (base.css). */
main:has(.lg) { max-width: 1080px; }
.lg { padding-bottom: var(--sp-5); }

/* ── header ── */
.lg-head { text-align: center; max-width: 720px; margin: 0 auto 2.4rem; animation: lg-rise .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lg-rise { from { opacity: 0; transform: translateY(14px); } }
.lg-kicker { font-family: var(--font-mono); font-size: var(--label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--accent); }
.lg-title { margin: .5rem 0 .7rem; font-size: clamp(2.3rem, 4.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; color: var(--ink); }
.lg-meta { margin: 0 0 1.2rem; font-size: var(--fs-sm); color: var(--muted); }
.lg-meta b { color: var(--ink-soft); font-weight: 600; }
.lg-tabs { display: inline-flex; padding: .25rem; background: var(--panel-alt); border: 1px solid var(--line); border-radius: 99px; }
.lg-tabs a { padding: .45rem 1.2rem; border-radius: 99px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); text-decoration: none; transition: background var(--ease), color var(--ease), box-shadow var(--ease); }
.lg-tabs a:hover { color: var(--ink); }
.lg-tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.lg-draft { display: flex; align-items: flex-start; gap: .75rem; max-width: 620px; margin: 1.4rem auto 0; padding: .8rem 1.1rem; background: var(--highlight); border: 1px solid #e3d49c; border-left: 3px solid #c9a227; border-radius: var(--radius); text-align: left; font-size: var(--fs-sm); line-height: 1.55; color: var(--ink); }
.lg-draft b { font-weight: 700; }
.lg-live { position: relative; flex-shrink: 0; width: 9px; height: 9px; margin-top: .45rem; border-radius: 50%; background: #c9a227; }
.lg-live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid #c9a227; animation: lg-ping 2s ease-out infinite; }
@keyframes lg-ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.lg-need { padding: .05rem .4rem; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-family: var(--font-mono); font-size: .82em; font-style: normal; }

/* ── contents + body ── */
.lg-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 3.2rem; align-items: start; border-top: var(--rule-double); padding-top: 2.2rem; }
.lg-toc { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
.lg-toc[hidden] { display: none; }
.lg-toc-h { margin-bottom: .7rem; font-family: var(--font-mono); font-size: .7rem; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.lg-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.lg-toc a { display: block; margin-left: -1px; padding: .38rem .9rem; border-left: 2px solid transparent; font-size: var(--fs-xs); line-height: 1.4; color: var(--ink-soft); text-decoration: none; transition: color var(--ease), border-color var(--ease), background var(--ease); }
.lg-toc a:hover { color: var(--ink); background: var(--accent-soft); }
.lg-toc a[aria-current="true"] { border-left-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.lg-body { max-width: 68ch; color: var(--ink-soft); font-size: var(--fs-base); line-height: 1.75; }
.lg-body > :first-child { margin-top: 0; }
.lg-body h2 { margin: 2.6rem 0 .8rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.012em; color: var(--ink); scroll-margin-top: 1.5rem; }
.lg-body h2:first-child, .lg-body > p:first-child + h2 { border-top: 0; padding-top: 0; }
.lg-body p { margin: 0 0 1rem; }
.lg-body strong, .lg-body b { color: var(--ink); }
.lg-body a { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(15,110,92,.35); text-underline-offset: 3px; transition: text-decoration-color var(--ease); }
.lg-body a:hover { text-decoration-color: var(--accent); }
.lg-body ul, .lg-body ol { margin: 0 0 1.1rem; padding: 0; list-style: none; }
.lg-body li { position: relative; margin-bottom: .55rem; padding-left: 1.5rem; }
.lg-body ul > li::before { content: ""; position: absolute; left: .15rem; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lg-body ol { counter-reset: lgn; }
.lg-body ol > li { counter-increment: lgn; }
.lg-body ol > li::before { content: counter(lgn); position: absolute; left: 0; top: .2em; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--font-mono); font-size: .68rem; font-weight: 600; line-height: 1.2rem; text-align: center; }
.lg-body code { padding: .08rem .35rem; border-radius: 4px; background: var(--panel-alt); font-family: var(--font-mono); font-size: .86em; color: var(--ink); }

/* tables read like the pricing ledger */
.lg-body table { width: 100%; margin: 1.2rem 0 1.6rem; border: 1px solid var(--ink); border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0; background: var(--panel-bg); box-shadow: 6px 6px 0 var(--accent-soft); overflow: hidden; font-size: var(--fs-sm); line-height: 1.6; }
.lg-body th { padding: .7rem 1.1rem; background: var(--panel-alt); border-bottom: 1px solid var(--ink); text-align: left; font-family: var(--font-mono); font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lg-body td { padding: .9rem 1.1rem; border-bottom: 1px dotted var(--line); vertical-align: top; }
.lg-body tr:last-child td { border-bottom: 0; }
.lg-body tbody tr:hover td { background: var(--accent-soft); }
.lg-body td:first-child { width: 62%; }

@media (max-width: 900px) {
  .lg-wrap { grid-template-columns: 1fr; gap: 1.4rem; }
  .lg-toc { display: none; }
  .lg-body table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .lg-head { animation: none; } .lg-live::after { animation: none; } }
@media print {
  .lg-toc, .lg-tabs, .sidebar, .back-link { display: none !important; }
  .lg-wrap { display: block; border-top: 0; }
  .lg-body { max-width: none; } .lg-body table { box-shadow: none; }
}
