/* ============================================================================
   Legal documents, made navigable.

   Terms of Use, the Privacy Policy and the Standard Grant Terms are all the
   same kind of thing: a long document somebody arrives at with one question,
   not a page anybody reads top to bottom. The treatment is therefore the same
   everywhere: a contents list you can point at and click, that follows you
   down the page on a desktop and sits at the top on a phone.

   Scoped to .legal so it cannot reach the rest of a page.
   ========================================================================== */

.legal .legal-in{
  max-width:var(--mw,1200px);
  display:grid;
  grid-template-columns:250px minmax(0,1fr);
  gap:52px;
  align-items:start;
}

/* ------------------------------------------------------------- contents */
.legal-toc{position:sticky;top:96px}
.legal-toc h2{
  font-family:var(--font-display);
  font-size:12px;letter-spacing:.1em;text-transform:uppercase;
  color:var(--gray,#475569);margin:0 0 14px;font-weight:700;
}
.legal-toc ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;counter-reset:sec}
.legal-toc li{counter-increment:sec}
.legal-toc a{
  display:block;padding:8px 10px;border-radius:8px;
  font-size:14px;line-height:1.4;color:var(--text,#2D3748);
  border-left:3px solid transparent;text-decoration:none;font-weight:400;
}
.legal-toc a::before{content:counter(sec) '. ';color:var(--muted,#A0AEC0);font-weight:600}
.legal-toc a:hover{background:var(--bg,#EDF2F7);color:var(--blue,#1E3EAF);border-left-color:var(--accent,#1C88ED)}
.legal-toc a.on{background:var(--bg,#EDF2F7);color:var(--blue,#1E3EAF);border-left-color:var(--blue,#1E3EAF);font-weight:600}

/* --------------------------------------------------------------- body */
.legal-body{min-width:0}
/* A heading landed under the sticky site header when clicked; this puts it
   back below it. */
.legal-body h3{scroll-margin-top:110px}
.legal-body > h2:first-child{margin-top:0}

/* A jumped-to section lights up briefly, so it is obvious where you landed
   in a wall of similar-looking text. */
@keyframes legal-land{from{background:#FFF8E1}to{background:transparent}}
.legal-body h3:target{animation:legal-land 1.6s ease-out}

.legal-updated{
  display:inline-block;background:var(--bg,#EDF2F7);border-radius:999px;
  padding:6px 14px;font-size:13px;color:var(--gray,#475569);
  font-family:var(--font-display);font-weight:600;margin-bottom:8px;
}

/* --------------------------------------------------------- back to top */
.legal-top{
  position:fixed;right:24px;bottom:24px;z-index:60;
  width:46px;height:46px;border-radius:50%;border:1px solid #D5DCE7;background:#fff;
  color:var(--blue,#1E3EAF);font-size:18px;line-height:1;cursor:pointer;
  box-shadow:0 6px 20px rgba(16,10,74,.16);
  opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s;
}
.legal-top.on{opacity:1;visibility:visible}
.legal-top:hover{background:var(--bg,#EDF2F7)}

@media(max-width:900px){
  .legal .legal-in{grid-template-columns:1fr;gap:28px}
  .legal-toc{position:static;background:var(--bg,#EDF2F7);border-radius:12px;padding:18px 18px 14px}
  .legal-toc ol{display:grid;grid-template-columns:1fr 1fr;gap:2px}
}
@media(max-width:560px){
  .legal-toc ol{grid-template-columns:1fr}
  .legal-top{right:14px;bottom:14px}
}
@media(prefers-reduced-motion:reduce){
  .legal-body h3:target{animation:none}
  .legal-top{transition:none}
}
