/* Legal pages (terms, privacy, refund, legal, licenses): calm reading layout.
   ~72ch text column; on wide screens the "On this page" list becomes a sticky side rail (pure CSS grid, no JS). */
body>main.wrap{width:100%;box-sizing:border-box}
.doc.legal{max-width:none;padding:clamp(40px,6vw,88px) 0 96px;font-size:16px;line-height:1.7}
.doc.legal>*{max-width:72ch}

/* Head: eyebrow, title, muted date, draft notice */
.doc.legal .doc-head{margin:0 0 36px;padding:0 0 28px;border-bottom:1px solid var(--line)}
.doc.legal .doc-head .eyebrow{margin:0 0 14px}
.doc.legal h1{font-size:clamp(34px,4.6vw,56px);line-height:1.05;letter-spacing:-.04em;font-weight:850;margin:0 0 14px;color:var(--ink)}
.doc.legal .doc-head>p:not(.eyebrow):not(.updated):not(.draft){font-size:clamp(16px,1.6vw,18px);color:var(--text-soft);margin:0}
.doc .updated{margin:0 0 18px;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.doc .draft{margin:0;padding:12px 16px;border:1px solid var(--line);border-radius:10px;font-size:14px;line-height:1.55;color:var(--text-soft);background:var(--soft)}
.doc .draft b{color:var(--ink);font-weight:650}

/* Body hierarchy */
.doc.legal h2{font-size:clamp(20px,2vw,24px);line-height:1.25;letter-spacing:-.02em;font-weight:750;color:var(--ink);margin:52px 0 12px}
.doc.legal h2 .note{font-size:14px;font-weight:500;letter-spacing:0;margin:0 0 0 4px}
.doc.legal h3{font-size:16px;font-weight:700;color:var(--ink);margin:28px 0 6px}
.doc.legal p{margin:0 0 14px;color:var(--text-soft)}
.doc.legal li{color:var(--text-soft);margin:6px 0}
.doc.legal .list{padding-left:22px;margin:0 0 14px}
.doc.legal b,.doc.legal strong{color:var(--ink);font-weight:650}
.doc.legal a:not(.button){color:var(--ink);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--ink) 30%,transparent);text-underline-offset:3px;text-decoration-thickness:1px}
.doc.legal a:not(.button):hover{text-decoration-color:var(--ai-to,#2563eb)}
.doc.legal code{font-family:Consolas,"SFMono-Regular",ui-monospace,monospace;font-size:.88em;padding:1px 5px;border-radius:5px;background:var(--soft);color:var(--ink);overflow-wrap:anywhere}
.doc h2[id],.doc h3[id]{scroll-margin-top:96px}

/* Licenses: package table and license texts stay intact, just framed */
.doc.legal table{width:100%;border-collapse:collapse;font-size:14px;line-height:1.45;margin:4px 0 8px}
.doc.legal th,.doc.legal td{padding:10px 10px 10px 0;border-bottom:1px solid var(--line);vertical-align:top}
.doc.legal th{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}
.doc.legal td:first-child{color:var(--ink);font-weight:600}
.doc.legal td a{font-size:13px}
.doc.legal pre{font-family:Consolas,"SFMono-Regular",ui-monospace,monospace;font-size:12.5px;line-height:1.6;color:var(--text-soft);background:var(--soft);border:1px solid var(--line);border-radius:10px;padding:16px 18px;margin:12px 0 20px;overflow:auto}

/* "On this page" list: compact card inline on narrow screens */
.toc-nav{margin:0 0 8px;padding:16px 18px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.toc-label{display:block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.14em;color:var(--muted);margin:0 0 8px}
.doc .toc{margin:0;padding:0;list-style:none;counter-reset:toc;font-size:14px;line-height:1.4}
.doc .toc li{margin:0;counter-increment:toc}
.doc .toc a{display:flex;gap:10px;padding:5px 0;color:var(--text-soft);text-decoration:none}
.doc .toc a:before{content:counter(toc,decimal-leading-zero);color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;padding-top:2px;min-width:18px}
.doc .toc a:hover{color:var(--ink)}
.doc.legal .toc a{text-decoration:none}
/* Added TOCs (not in the original page text) only appear where there's room for the rail */
.toc-nav:not(.toc-orig){display:none}

@media (min-width:1080px){
  .doc.legal.has-toc{display:grid;grid-template-columns:220px minmax(0,72ch);column-gap:clamp(48px,6vw,96px);justify-content:center}
  .doc.legal.has-toc>*{grid-column:2}
  .doc.legal.has-toc>.toc-nav{display:block;grid-column:1;grid-row:1/span 300;align-self:start;position:sticky;top:96px;max-height:calc(100vh - 120px);overflow:auto;margin:0;padding:6px 0 0;border:0;border-radius:0;background:none}
  .doc.legal.has-toc>.toc-nav .toc{font-size:13px;border-left:1px solid var(--line)}
  .doc.legal.has-toc>.toc-nav .toc a{padding:6px 0 6px 14px;margin-left:-1px;border-left:1px solid transparent}
  .doc.legal.has-toc>.toc-nav .toc a:hover{border-left-color:var(--ink)}
}

@media (max-width:600px){
  .doc.legal table{display:block;overflow-x:auto}
  .doc.legal pre{font-size:11.5px;padding:12px}
}
.doc.legal th{white-space:nowrap;overflow-wrap:normal}
.doc.legal td:first-child{overflow-wrap:normal;word-break:normal}
.doc.legal .doc-head+h2,.doc.legal .doc-head+.toc-nav+h2{margin-top:8px}
