/* ── Legal hero strip ────────────────────────────────────────────────────────── */
.legal-lede { color: var(--rx-ink-soft); }
.legal-hero {
  padding: 64px 0 40px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(123,182,217,0.28), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F4F8FC 100%);
  border-bottom: 1px solid var(--rx-line);
}

/* ── Doc tabs (in hero) ──────────────────────────────────────────────────────── */
.doc-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #fff; border: 1px solid var(--rx-line); border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.doc-tabs button {
  border: 0; background: transparent; padding: 9px 16px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--rx-ink-soft); cursor: pointer;
  transition: all .15s ease;
}
.doc-tabs button:hover { color: var(--rx-primary); }
.doc-tabs button.active { background: var(--rx-primary); color: #fff; box-shadow: 0 2px 6px rgba(20,90,152,.3); }

/* ── Meta row ────────────────────────────────────────────────────────────────── */
.meta-row {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-top: 28px; color: var(--rx-muted); font-size: 13px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
}
.meta-row .item { display: inline-flex; align-items: center; gap: 8px; }
.meta-row .item strong { color: var(--rx-ink); font-weight: 600; }

/* ── Body layout ─────────────────────────────────────────────────────────────── */
main.legal-main { flex: 1; padding: 48px 0 80px; }
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; gap: 24px; } .toc { position: static !important; } }

/* ── Table of contents ───────────────────────────────────────────────────────── */
.toc {
  position: sticky; top: 86px; align-self: start;
  background: var(--rx-bg-tint); border: 1px solid var(--rx-line); border-radius: var(--rx-radius);
  padding: 18px;
}
.toc .label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--rx-muted);
  margin-bottom: 10px;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block; padding: 7px 0; padding-left: 28px; position: relative;
  color: var(--rx-ink-soft); text-decoration: none; font-size: 14px; line-height: 1.35;
  border-radius: 6px;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--rx-muted); font-weight: 600;
}
.toc a:hover { color: var(--rx-primary); }
.toc a.active { color: var(--rx-primary); font-weight: 600; }

/* ── Article content ─────────────────────────────────────────────────────────── */
article { max-width: 720px; }
article p { color: var(--rx-ink-soft); margin: 0 0 1em; }
article p strong { color: var(--rx-ink); font-weight: 600; }
article ul { color: var(--rx-ink-soft); padding-left: 1.4em; margin: 0 0 1em; }
article ul li { margin-bottom: 6px; }
article a { color: var(--rx-primary); font-weight: 500; text-decoration: none; }
article a:hover { text-decoration: underline; }
article h2 { font-size: 1.5rem; margin-top: 2.4em; margin-bottom: 0.5em; letter-spacing: -0.025em; }
article h3 { font-size: 1.05rem; margin-top: 1.6em; margin-bottom: 0.4em; }

.callout {
  background: var(--rx-bg-tint); border: 1px solid var(--rx-line);
  border-left: 3px solid var(--rx-primary);
  border-radius: 10px; padding: 18px 20px; margin: 20px 0;
  font-size: 15px; color: var(--rx-ink-soft);
}
.callout strong { color: var(--rx-ink); }

/* ── Doc visibility ──────────────────────────────────────────────────────────── */
.doc { display: none; }
.doc.active { display: block; }

/* ── Summary grid (Terms) ────────────────────────────────────────────────────── */
.summary-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin: 24px 0 28px;
}
@media (max-width: 600px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-grid .item {
  background: #fff; border: 1px solid var(--rx-line); border-radius: 12px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
}
.summary-grid .item .ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(180deg, #E8F2FB, #D0E3F3);
  color: var(--rx-primary); display: grid; place-items: center; flex: 0 0 auto;
}
.summary-grid .item .t { font-weight: 600; font-size: 14px; line-height: 1.2; margin-bottom: 2px; color: var(--rx-ink); }
.summary-grid .item .s { font-size: 13px; color: var(--rx-ink-soft); line-height: 1.4; }

.section-anchor { scroll-margin-top: 96px; }
