html.legal-html { background: var(--bg); }
.legal-page { position: relative; z-index: 1; background: var(--bg); min-height: 100vh; overflow-x: clip; }
.legal-page .topbar.theme-white { position: relative; background: var(--bg); box-shadow: none; }
.back-link { font-weight: 600; color: var(--blue); text-decoration: none; font-size: .95rem; }
.legal-main { max-width: 820px; margin: 0 auto; padding: 20px 20px 80px; color: var(--text); overflow-wrap: break-word; }
.legal-main h1 { font-size: 2rem; margin-bottom: 4px; }
.legal-main .updated, .legal-main .legal-version { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.legal-main h2 { font-size: 1.3rem; margin-top: 40px; margin-bottom: 12px; }
.legal-main h3 { font-size: 1.05rem; margin-top: 28px; margin-bottom: 8px; color: var(--blue-deep); }
.legal-main p, .legal-main li { margin: 10px 0; color: var(--muted); line-height: 1.6; }
.legal-main ul, .legal-main ol { padding-left: 1.4em; }
.legal-main a { color: var(--blue); }
.legal-main hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.legal-main section { scroll-margin-top: 16px; }
.license-table-wrap { margin: 20px 0; }
table.license-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .92rem; }
table.license-table th, table.license-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.license-table th:nth-child(1) { width: 30%; }
table.license-table th:nth-child(2) { width: 38%; }
table.license-table th { color: var(--text); font-weight: 700; }
table.license-table td { color: var(--muted); }
.legal-doc blockquote { margin: 1rem 0; padding: 0; border: 0; font-size: 1.78em; line-height: 1.55; }
.legal-doc blockquote p { color: var(--text); line-height: inherit; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92rem; line-height: 1.45; }
.legal-doc th, .legal-doc td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; color: var(--muted); overflow-wrap: anywhere; }
.legal-doc th, .legal-doc table:not(:has(tr > :nth-child(3))) td:first-child:not(:last-child) { background: var(--blue-soft); color: var(--text); font-weight: 700; }
.legal-doc td p, .legal-doc th p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.legal-doc td p + p { margin-top: .5em; }
.legal-footer { max-width: 820px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.legal-footer a { color: var(--blue); text-decoration: none; }
@media (max-width: 640px) {
  .legal-main h1 { font-size: 1.6rem; }
  table.license-table th, table.license-table td { padding: 8px 6px; }
  .legal-doc blockquote { font-size: 1.4em; }
  .legal-doc table:not(:has(tr > :nth-child(3))),
  .legal-doc table:not(:has(tr > :nth-child(3))) tbody,
  .legal-doc table:not(:has(tr > :nth-child(3))) tr,
  .legal-doc table:not(:has(tr > :nth-child(3))) td { display: block; width: auto; border: 0; }
  .legal-doc table:not(:has(tr > :nth-child(3))) thead:not(:has(th:not(:empty))),
  .legal-doc table:not(:has(tr > :nth-child(3))) td:empty { display: none; }
  .legal-doc table:not(:has(tr > :nth-child(3))) tbody tr { margin: 0 0 .6rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .legal-doc table:not(:has(tr > :nth-child(3))) td + td { padding-top: .35rem; }
}
