:root {
  --ink: #0a0a0a;
  --muted: #666;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --blue: #126fbd;
  --shell: 1120px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font-family: Inter, Arial, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: color .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
a:focus-visible { outline: 3px solid rgba(18,111,189,.18); outline-offset: 3px; }
.legal-shell { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }

.legal-header { position: sticky; z-index: 10; top: 0; height: 64px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(14px); }
.legal-header-inner { display: flex; height: 100%; align-items: center; gap: 14px; }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.brand-mark { position: relative; display: inline-block; width: 18px; height: 18px; color: currentColor; transform: rotate(45deg); }
.brand-mark::before { position: absolute; top: 1px; left: 1px; width: 7px; height: 7px; border-radius: 3px 1px 1px; background: currentColor; box-shadow: 9px 0 0 currentColor, 0 9px 0 currentColor, 9px 9px 0 currentColor; content: ""; }
.legal-divider { width: 1px; height: 20px; background: var(--line); }
.legal-section-name { color: var(--muted); font-size: 12px; }
.legal-language { margin-left: auto; }
.legal-header-actions { display: flex; min-width: 0; align-items: center; gap: 22px; font-size: 13px; font-weight: 500; }
.legal-header-actions a:hover { color: var(--blue); }
.legal-header-actions .console-link { padding: 9px 14px; border: 1px solid #d4d4d4; border-radius: 7px; background: #fff; }

.legal-hero { border-bottom: 1px solid var(--line); background: #f8fcff; }
.legal-hero-inner { padding-block: 72px 64px; }
.legal-kicker { margin: 0 0 14px; color: var(--blue); font-family: "Roboto Mono", Consolas, monospace; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.legal-hero h1 { max-width: 760px; margin: 0; font-size: 48px; font-weight: 600; line-height: 1.12; }
.legal-summary { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 18px; margin: 30px 0 0; color: var(--muted); font-size: 12px; }
.legal-meta strong { color: var(--ink); font-weight: 600; }

.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 72px; justify-content: space-between; padding-block: 56px 88px; }
.legal-toc { position: sticky; top: 94px; max-height: calc(100vh - 118px); align-self: start; overflow-y: auto; scrollbar-width: thin; }
.legal-toc p { margin: 0 0 12px; color: #999; font-family: "Roboto Mono", Consolas, monospace; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.legal-toc nav { display: grid; gap: 3px; }
.legal-toc a { padding: 7px 10px; border-left: 2px solid transparent; color: var(--muted); font-size: 12px; line-height: 1.4; }
.legal-toc a:hover { border-color: var(--ink); color: var(--ink); }
.legal-content { min-width: 0; }
.legal-intro { margin: 0 0 42px; padding: 20px 22px; border-left: 3px solid var(--ink); background: var(--soft); color: #444; line-height: 1.7; }
.legal-content section { padding: 0 0 36px; scroll-margin-top: 92px; }
.legal-content section:target h2 { color: var(--blue); }
.legal-content section + section { padding-top: 36px; border-top: 1px solid var(--line); }
.legal-content h2 { margin: 0 0 18px; font-size: 22px; font-weight: 600; line-height: 1.3; }
.legal-content h3 { margin: 24px 0 10px; font-size: 15px; font-weight: 600; }
.legal-content p, .legal-content li { color: #454545; line-height: 1.75; }
.legal-content p { margin: 0 0 14px; }
.legal-content ul { margin: 12px 0 0; padding-left: 20px; }
.legal-content li + li { margin-top: 8px; }
.legal-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.legal-content strong { color: var(--ink); }

.legal-footer { border-top: 1px solid var(--line); background: #fafafa; }
.legal-footer-inner { display: flex; min-height: 92px; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.legal-footer-inner nav { display: flex; gap: 18px; margin-left: auto; }
.legal-footer-inner a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .legal-shell { width: min(100% - 32px, var(--shell)); }
  .legal-section-name, .legal-header-actions > a:not(.console-link) { display: none; }
  .legal-header-actions { gap: 0; }
  .legal-hero-inner { padding-block: 48px 44px; }
  .legal-hero h1 { font-size: 36px; }
  .legal-summary { font-size: 15px; }
  .legal-layout { display: block; padding-block: 36px 64px; }
  .legal-toc { position: static; max-height: none; margin-bottom: 42px; padding-bottom: 26px; overflow: visible; border-bottom: 1px solid var(--line); }
  .legal-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-footer-inner { align-items: flex-start; flex-direction: column; padding-block: 24px; }
  .legal-footer-inner nav { flex-wrap: wrap; margin-left: 0; }
}

@media (max-width: 520px) {
  .legal-header-actions { display: none; }
  .legal-language .pico-language-button { width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
