/*
 * Terms of Service and Privacy Policy (/terms, /privacy, their history) and the "updated terms"
 * review screen (/legal/review). Loaded after home-minimal.css, which resets margins globally.
 */
:root {
  --lg-ink: #0f172a;
  --lg-ink-2: #334155;
  --lg-muted: #64748b;
  --lg-line: #e2e8f0;
  --lg-surface: #ffffff;
  --lg-page: #fafafa;
  --lg-soft: #f1f5f9;
  --lg-blue: #0074ff;
  --lg-blue-soft: #eef5ff;
  --lg-blue-line: #cfe2ff;
  --lg-amber-soft: #fff8e6;
  --lg-amber-line: #f5d58a;
  --lg-red: #b42318;
  --lg-red-soft: #fff1f0;
  --lg-radius: 18px;
  --lg-measure: 42rem;
}

.lg { width: 100%; }

/* Top bar */
.lg-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100% - 1180px) / 2));
  background: rgba(250, 250, 250, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.lg-bar__brand img { display: block; height: 22px; width: auto; }
.lg-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #ececf0;
}
.lg-seg a {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lg-ink-2);
  text-decoration: none;
}
.lg-seg a[aria-current="page"] {
  background: var(--lg-surface);
  color: var(--lg-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Notices */
.lg-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  padding: 12px 16px;
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
  color: var(--lg-ink);
}
.lg-notice a { color: var(--lg-blue); font-weight: 600; text-decoration: none; }
.lg-notice a:hover { text-decoration: underline; }
.lg-notice--upcoming { background: var(--lg-blue-soft); border-bottom: 1px solid var(--lg-blue-line); }
.lg-notice--archived { background: var(--lg-amber-soft); border-bottom: 1px solid var(--lg-amber-line); }

/* Hero */
.lg-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) 16px 32px;
  text-align: center;
}
.lg-eyebrow {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lg-muted);
}
.lg-eyebrow a { color: inherit; text-decoration: none; }
.lg-eyebrow a:hover { color: var(--lg-blue); }
.lg-hero h1,
.lg-review h1 {
  max-width: none;
  margin: 0 auto 14px;
  font-size: clamp(2.25rem, 6.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--lg-ink);
}
.lg-meta { margin: 0 auto; max-width: 40rem; color: var(--lg-muted); font-size: 1.0625rem; line-height: 1.5; }
.lg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.lg-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.lg-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--lg-line);
  border-radius: 999px;
  background: var(--lg-surface);
  color: var(--lg-ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.lg-pill:hover { border-color: #cbd5e1; color: var(--lg-ink); }

/* What changed */
.lg-changes {
  width: calc(100% - 32px);
  max-width: calc(var(--lg-measure) + 64px);
  margin: 8px auto 40px;
  padding: 24px 28px;
  border-radius: var(--lg-radius);
  background: var(--lg-blue-soft);
  border: 1px solid var(--lg-blue-line);
}
.lg-changes h2 { margin: 0 0 10px; font-size: 1.0625rem; font-weight: 700; color: var(--lg-ink); }
.lg-changes ul { margin: 0; padding-left: 1.2em; }
.lg-changes li { margin: 6px 0; line-height: 1.55; color: var(--lg-ink-2); }

/* Body: index + document */
.lg-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 96px;
}
@media (min-width: 1000px) {
  .lg-body { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; }
}

.lg-toc__box {
  border: 1px solid var(--lg-line);
  border-radius: 14px;
  background: var(--lg-surface);
}
.lg-toc__box > summary {
  list-style: none;
  padding: 14px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lg-muted);
  cursor: pointer;
}
.lg-toc__box > summary::-webkit-details-marker { display: none; }
.lg-toc__box > summary::after { content: "＋"; float: right; font-weight: 400; }
.lg-toc__box[open] > summary::after { content: "－"; }
.lg-toc ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.lg-toc a {
  display: flex;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--lg-ink-2);
  text-decoration: none;
}
.lg-toc a:hover { background: var(--lg-soft); color: var(--lg-ink); }
.lg-toc a[aria-current="true"] { background: var(--lg-blue-soft); color: var(--lg-blue); font-weight: 600; }
.lg-toc__num { min-width: 1.6em; color: var(--lg-muted); font-variant-numeric: tabular-nums; }
.lg-toc a[aria-current="true"] .lg-toc__num { color: var(--lg-blue); }
@media (min-width: 1000px) {
  .lg-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; }
  .lg-toc__box { border: 0; background: transparent; }
  .lg-toc__box > summary { padding: 0 8px 10px; cursor: default; pointer-events: none; }
  .lg-toc__box > summary::after,
  .lg-toc__box[open] > summary::after { content: none; }
  .lg-toc ol { padding: 0; }
}

/* The document */
.lg-doc {
  min-width: 0;
  max-width: var(--lg-measure);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--lg-ink-2);
  -webkit-font-smoothing: antialiased;
}
.lg-doc > :first-child { margin-top: 0; }
.lg-doc h2 {
  scroll-margin-top: 84px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 64px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--lg-line);
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--lg-ink);
}
.lg-doc h2:first-of-type { margin-top: 0; }
.lg-doc h3 {
  scroll-margin-top: 84px;
  margin: 32px 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--lg-ink);
}
.lg-doc h4 { margin: 24px 0 6px; font-size: 1rem; font-weight: 700; color: var(--lg-ink); }
.lg-num { color: var(--lg-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-doc h3 .lg-num { margin-right: 6px; }
.lg-doc p { margin: 0 0 16px; }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 1.3em; }
.lg-doc li { margin: 6px 0; padding-left: 2px; }
.lg-doc li > ul, .lg-doc li > ol { margin: 6px 0 0; }
.lg-doc a { color: var(--lg-blue); text-decoration: none; }
.lg-doc a:hover { text-decoration: underline; }
.lg-doc strong, .lg-doc b { color: var(--lg-ink); font-weight: 650; }
.lg-doc hr { margin: 32px 0; border: 0; border-top: 1px solid var(--lg-line); }
.lg-doc code { font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--lg-soft); }

/* Plain-language summary of a section */
.lg-doc .legal-short {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--lg-soft);
  color: var(--lg-ink);
  font-size: 1rem;
  line-height: 1.6;
}
.lg-doc .legal-short strong:first-child {
  display: block;
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lg-muted);
}

/* Notices inside the text (Quote blocks, older notice boxes) */
.lg-doc .legal-callout,
.lg-doc blockquote {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid var(--lg-line);
  border-left: 4px solid var(--lg-blue);
  border-radius: 12px;
  background: var(--lg-surface);
  font-size: 0.9875rem;
  line-height: 1.6;
  color: var(--lg-ink);
}
.lg-doc .legal-callout--strong {
  border-color: #f3c4bf;
  border-left-color: var(--lg-red);
  background: var(--lg-red-soft);
}
.lg-doc .legal-callout p:last-child, .lg-doc blockquote p:last-child { margin-bottom: 0; }
.lg-doc .legal-callout > strong:first-child,
.lg-doc .legal-callout > p:first-child > strong:first-child {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Tables */
.lg-doc .legal-table { margin: 16px 0 24px; overflow-x: auto; border: 1px solid var(--lg-line); border-radius: 12px; background: var(--lg-surface); }
.lg-doc table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.lg-doc th, .lg-doc td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--lg-line); }
.lg-doc tr:last-child td { border-bottom: 0; }
.lg-doc th { background: var(--lg-soft); color: var(--lg-ink); font-weight: 650; font-size: 0.875rem; white-space: nowrap; }
.lg-doc td:first-child { color: var(--lg-ink); font-weight: 600; min-width: 9rem; }

.lg-doc__foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--lg-line); font-size: 0.9375rem; color: var(--lg-muted); }
.lg-doc__foot p { margin: 0 0 4px; }

.lg-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--lg-ink);
  color: #fff;
  font-size: 1.125rem;
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.lg-top.is-shown { opacity: 0.88; transform: none; pointer-events: auto; }

/* Version history */
.lg-history { list-style: none; max-width: 52rem; margin: 0 auto; padding: 0 16px 96px; }
.lg-history__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 32px;
  padding: 24px 0;
  border-top: 1px solid var(--lg-line);
}
@media (min-width: 720px) { .lg-history__item { grid-template-columns: 200px minmax(0, 1fr); } }
.lg-history__date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; color: var(--lg-ink); }
.lg-history__title { font-size: 1.0625rem; font-weight: 700; color: var(--lg-blue); text-decoration: none; }
.lg-history__title:hover { text-decoration: underline; }
.lg-history__main ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--lg-ink-2); line-height: 1.6; }
.lg-history__main p { margin: 6px 0 0; color: var(--lg-muted); }
.lg-tag { padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.lg-tag--current { background: #e7f8ee; color: #0f7a3d; }
.lg-tag--upcoming { background: var(--lg-blue-soft); color: var(--lg-blue); }

/* Review screen (signed in, an update is in effect) */
.lg-review { display: flex; justify-content: center; padding: clamp(24px, 6vw, 72px) 16px 72px; }
.lg-review__card {
  width: 100%;
  max-width: 600px;
  padding: clamp(24px, 5vw, 44px);
  border-radius: 24px;
  background: var(--lg-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.08);
}
.lg-review__logo { display: block; height: 24px; width: auto; margin-bottom: 32px; }
.lg-review h1 { margin: 0 0 12px; font-size: clamp(1.75rem, 5vw, 2.25rem); text-align: left; }
.lg-review__lede { margin: 0 0 24px; font-size: 1.0625rem; line-height: 1.55; color: var(--lg-ink-2); }
.lg-review__error { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--lg-red-soft); color: var(--lg-red); font-weight: 600; }
.lg-review__doc { margin: 0 0 14px; padding: 18px 20px; border-radius: 16px; background: var(--lg-soft); }
.lg-review__doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.lg-review__doc h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--lg-ink); }
.lg-review__doc-head span { font-size: 0.875rem; color: var(--lg-muted); }
.lg-review__doc ul { margin: 10px 0 10px; padding-left: 1.2em; color: var(--lg-ink-2); line-height: 1.55; font-size: 0.9875rem; }
.lg-review__doc li { margin: 4px 0; }
.lg-review__read { display: inline-block; margin-top: 4px; font-size: 0.9375rem; font-weight: 600; color: var(--lg-blue); text-decoration: none; }
.lg-review__form { display: grid; gap: 12px; margin-top: 24px; }
.lg-review__check { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0 8px; font-size: 0.9375rem; line-height: 1.5; color: var(--lg-ink-2); cursor: pointer; }
.lg-review__check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--lg-blue); }
.lg-review__check a { color: var(--lg-blue); }
.lg-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.lg-btn--primary { background: var(--lg-blue); color: #fff; }
.lg-btn--primary:hover { background: #0066e0; }
.lg-btn--plain { background: transparent; color: var(--lg-ink-2); }
.lg-btn--plain:hover { background: var(--lg-soft); }
.lg-btn--danger { background: var(--lg-red-soft); color: var(--lg-red); }
.lg-review__more { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--lg-line); font-size: 0.9375rem; color: var(--lg-ink-2); }
.lg-review__more summary { cursor: pointer; font-weight: 600; color: var(--lg-ink); }
.lg-review__more p { margin: 10px 0 12px; line-height: 1.55; }
.lg-review__inline { margin: 0 0 10px; }
.lg-review__delete { display: grid; gap: 8px; margin-top: 12px; }
.lg-review__delete input { padding: 12px 14px; border: 1px solid var(--lg-line); border-radius: 12px; font: inherit; }
.lg-review__signed { margin: 24px 0 0; text-align: center; font-size: 0.8125rem; color: var(--lg-muted); }

/* Print: just the document */
@media print {
  .lg-bar, .lg-toc, .lg-actions, .lg-top, .lg-notice, .af-footer, footer.site-footer, .privacy-banner { display: none !important; }
  .lg-body { display: block; padding: 0; }
  .lg-hero { padding: 0 0 16px; text-align: left; }
  .lg-hero h1 { font-size: 26pt; }
  .lg-doc { max-width: none; font-size: 10.5pt; color: #000; }
  .lg-doc h2 { break-after: avoid; border-top: 0; margin-top: 24pt; padding-top: 0; }
  .lg-doc .legal-short, .lg-doc .legal-callout, .lg-changes { break-inside: avoid; }
  .lg-doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-top { transition: none; }
}

/* Your Privacy Choices (/privacy/choices) */
.pc { max-width: 44rem; margin: 0 auto; padding: 0 16px 96px; }
.pc-flash {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #e7f8ee;
  color: #0f7a3d;
  font-weight: 600;
}
.pc-facts { display: grid; gap: 12px; margin-bottom: 32px; }
@media (min-width: 680px) { .pc-facts { grid-template-columns: 1fr 1fr; } }
.pc-fact {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  background: var(--lg-surface);
}
.pc-fact--on { border-color: var(--lg-blue-line); background: var(--lg-blue-soft); }
.pc-fact__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--lg-soft);
  color: var(--lg-blue);
  font-size: 1rem;
}
.pc-fact--on .pc-fact__icon { background: var(--lg-surface); }
.pc-fact strong { display: block; margin-bottom: 2px; color: var(--lg-ink); font-size: 0.9875rem; }
.pc-fact span { color: var(--lg-ink-2); font-size: 0.9375rem; line-height: 1.5; }
.pc-who { margin: 0 0 24px; color: var(--lg-ink-2); font-size: 1rem; line-height: 1.55; }
.pc-who a, .pc-note a { color: var(--lg-blue); text-decoration: none; font-weight: 600; }
.pc-group { margin: 0 0 28px; }
.pc-group h2 {
  margin: 0 0 8px 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lg-muted);
}
.pc-card { border: 1px solid var(--lg-line); border-radius: var(--lg-radius); background: var(--lg-surface); overflow: hidden; }
.pc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  cursor: pointer;
}
.pc-row + .pc-row { border-top: 1px solid var(--lg-line); }
.pc-row:has(.pc-switch:disabled) { cursor: default; }
.pc-row__text { display: grid; gap: 3px; }
.pc-row__title { color: var(--lg-ink); font-size: 1rem; font-weight: 600; line-height: 1.35; }
.pc-row__detail { color: var(--lg-muted); font-size: 0.9rem; line-height: 1.5; }
.pc-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lg-blue-soft);
  color: var(--lg-blue);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: 2px;
}
.pc-switch {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: #e2e2e7;
  cursor: pointer;
  transition: background 0.2s;
}
.pc-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s;
}
.pc-switch:checked { background: #34c759; }
.pc-switch:checked::after { transform: translateX(20px); }
.pc-switch:disabled { opacity: 0.55; cursor: default; }
.pc-switch:focus-visible { outline: 3px solid var(--lg-blue-line); outline-offset: 2px; }
.pc-note { margin: 8px 4px 0; color: var(--lg-muted); font-size: 0.875rem; line-height: 1.5; }
.pc-save { position: sticky; bottom: 16px; margin: 8px 0 36px; }
.pc-save .lg-btn { box-shadow: 0 8px 24px rgba(0, 116, 255, 0.25); }
.pc-rights { display: grid; gap: 12px; }
@media (min-width: 680px) { .pc-rights { grid-template-columns: 1fr 1fr; } }
.pc-right {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  background: var(--lg-surface);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pc-right:hover { border-color: #cbd5e1; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); }
.pc-right strong { color: var(--lg-ink); font-size: 1rem; }
.pc-right strong::after { content: " →"; color: var(--lg-blue); }
.pc-right span { color: var(--lg-muted); font-size: 0.9rem; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .pc-switch, .pc-switch::after { transition: none; } }
