/* ============================================================================
   ONFLOW ADS — THE LEGAL DOCUMENTS (/terms, /privacy, /refunds)
   ----------------------------------------------------------------------------
   One stylesheet for the three documents, loaded after /styles.css. It uses
   the site's tokens (colours, type, spacing) and adds only what a long legal
   document needs: a calm reading sheet, numbered sections and clauses, the
   "In short" summaries, definitions, callouts, tables that become cards on a
   phone, the contents rail, the phone contents bar and drawer, the
   search-within-the-document controls and a print style.

   The page is built in two layers, and the split matters:
     * the DOCUMENT is one <article class="lg-doc"> inside <main>. Everything a
       reader needs is in it, and nothing else is;
     * the INTERFACE (contents, search, buttons, progress) sits outside the
       article: the rails are <aside>s beside <main>, the phone bar and the
       floating button come after it.
   The markup contract for writers is the legal design note kept with the
   rebuild; the shell page shows where everything goes.

   Breakpoints: 1000px (the contents rail appears; below it the phone bar and
   drawer take over), 1360px (the "In this section" rail appears), 640px (tables
   become cards, definitions stack, the sheet goes edge to edge).
   ============================================================================ */

/* ---- Tokens ------------------------------------------------------------- */
.lg-page {
  --lg-gutter: 24px;
  --lg-size: 1.0625rem;          /* 17px body text                          */
  --lg-line: 1.78;
  --lg-measure: 44rem;           /* the paragraph measure, about 70 characters */
  --lg-sheet: rgba(9, 10, 15, 0.9);
  --lg-sheet-line: rgba(255, 255, 255, 0.075);
  --lg-ink: #E2E4EA;             /* body text on the sheet (14:1)           */
  --lg-ink-2: var(--text-dim);   /* secondary                               */
  --lg-ink-3: var(--text-faint); /* labels                                  */
  --lg-link: #FF5C64;            /* a lighter Onflow Red for text links: 6.1:1 on the sheet */
  --lg-red-soft: rgba(251, 44, 54, 0.08);
  --lg-red-line: rgba(251, 44, 54, 0.36);
  --lg-panel: rgba(255, 255, 255, 0.035);
  --lg-panel-2: rgba(255, 255, 255, 0.06);
  --lg-mbar-h: 0px;              /* height of the phone contents bar, when shown */
  --lg-top: calc(var(--nav-h) + var(--top-offset, 0px));
  --lg-radius: 14px;
}
@media (min-width: 1600px) { .lg-page { --lg-size: 1.125rem; --lg-measure: 46rem; } }
@media (max-width: 640px)  { .lg-page { --lg-size: 1rem; --lg-line: 1.74; --lg-gutter: 16px; } }
@media (max-width: 999.98px) { .lg-page { --lg-mbar-h: 50px; } }

/* While the phone drawer is open the page behind it does not scroll, and the
   support launcher steps aside (the site menu does the same: html.ofm-open). */
html.lg-lock { overflow: hidden; }
html.lg-lock .ofg-supp { display: none; }

/* ============================================================================
   1. LAYOUT
   ============================================================================ */
.lg {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: var(--nav-gap) var(--lg-gutter) var(--space-20);
}
.lg-main { min-width: 0; }
.lg-main:focus { outline: none; box-shadow: none; }

@media (min-width: 1000px) {
  .lg {
    display: grid;
    grid-template-columns: minmax(216px, 268px) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 48px);
    align-items: start;
  }
}
@media (min-width: 1360px) {
  .lg { grid-template-columns: 264px minmax(0, 1fr) 220px; }
}
.lg-side { display: none; }
@media (min-width: 1360px) { .lg-side { display: block; } }

/* ---- The reading sheet ---- */
.lg-doc {
  position: relative;
  max-width: calc(var(--lg-measure) + 2 * clamp(20px, 4vw, 64px));
  margin-inline: auto;
  padding: clamp(28px, 4vw, 64px) clamp(20px, 4vw, 64px) clamp(36px, 5vw, 72px);
  background: var(--lg-sheet);
  border: 1px solid var(--lg-sheet-line);
  border-radius: 22px;
  box-shadow: 0 40px 120px -60px rgba(0, 0, 0, 0.9);
  color: var(--lg-ink-2);
  font-size: var(--lg-size);
  line-height: var(--lg-line);
  overflow-wrap: break-word;
  hyphens: manual;
}
@media (max-width: 640px) {
  .lg { padding-top: 0; }
  .lg-doc {
    margin-inline: calc(-1 * var(--lg-gutter));
    padding: 28px var(--lg-gutter) 40px;
    border-radius: 0;
    border-inline: 0;
    box-shadow: none;
  }
}

/* Every element in the article that can be a link target clears the bar
   (the root's scroll-padding already clears the site bar; this adds the phone
   contents bar and a little air). */
.lg-doc [id] { scroll-margin-top: calc(var(--lg-mbar-h) + 12px); }

/* Arrive at once. The site animates anchor scrolling, which on a document this
   long turned a deep link (the cookie banner's /privacy#cookies-third, a clause
   cited from another page) into a second of the page sliding past, and left a
   reader who arrived early mid-way. The arrival highlight shows where you landed;
   legal.js still animates its own moves (back to top, search) unless motion is
   reduced. (QA, 14 Oct.) */
html:has(> body.lg-page) { scroll-behavior: auto; }

/* ============================================================================
   2. THE DOCUMENT HEAD — title, lead, Published / Effective / Version, archive
   ============================================================================ */
.lg-hero { padding-bottom: clamp(24px, 3vw, 36px); margin-bottom: clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--border-faint); }
.lg-hero::before {               /* decoration, not document text */
  content: "Legal";
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: var(--space-4);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lg-link);
}
.lg-hero h1 {
  color: var(--text);
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 18ch;
  overflow-wrap: anywhere;
}
.lg-hero__lead {
  margin-top: var(--space-4);
  max-width: 40rem;
  color: var(--lg-ink-2);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.13rem);
  line-height: 1.65;
}
.lg-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: var(--space-6);
}
.lg-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--lg-panel);
  font-size: 0.85rem; line-height: 1.4;
}
.lg-chip dt { color: var(--lg-ink-3); font-weight: 500; }
.lg-chip dd { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-chip--key { border-color: var(--lg-red-line); background: var(--lg-red-soft); }
.lg-chip--key dt { color: #FFB3B7; }
.lg-hero__archive {
  margin-top: var(--space-4);
  font-size: 0.9rem; line-height: 1.6;
  color: var(--lg-ink-3);
  max-width: 40rem;
}

/* ============================================================================
   3. WHAT IS CHANGING (the summary of material changes)
   ============================================================================ */
.lg-changes {
  margin: 0 0 clamp(32px, 4vw, 48px);
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--lg-red-line);
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(251, 44, 54, 0.10), transparent 55%),
    var(--lg-panel);
}
.lg-changes > h2 {
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
  font-size: 1.15rem; letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
}
.lg-changes > h2::before {
  content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 4px rgba(251, 44, 54, 0.18);
}
.lg-changes p { margin: 0 0 var(--space-3); color: var(--lg-ink); max-width: var(--lg-measure); }
.lg-changes ul { margin: var(--space-4) 0 var(--space-3); padding: 0; list-style: none; }
.lg-changes li {
  position: relative; margin: 0; padding: 11px 0 11px 26px;
  border-top: 1px solid var(--border-faint);
  line-height: 1.65;
}
.lg-changes li:first-child { border-top: 0; padding-top: 2px; }
.lg-changes li::before {
  content: ""; position: absolute; left: 2px; top: calc(11px + 0.82em); width: 12px; height: 2px; border-radius: 2px;
  background: var(--red);
}
.lg-changes li:first-child::before { top: calc(2px + 0.82em); }
.lg-changes li strong { color: var(--text); }
.lg-changes .lg-changes__nb { margin: var(--space-3) 0 0; font-size: 0.86rem; color: var(--lg-ink-3); }

/* ============================================================================
   4. PROSE
   ============================================================================ */
:where(.lg-doc) p, :where(.lg-doc) ul, :where(.lg-doc) ol, :where(.lg-doc) dl, :where(.lg-doc) .lg-tblwrap,
:where(.lg-doc) .lg-callout, :where(.lg-doc) .lg-short { max-width: var(--lg-measure); }
:where(.lg-doc) p { margin: 0 0 1.05em; }
:where(.lg-doc) strong, :where(.lg-doc) b { color: var(--text); font-weight: 600; }
:where(.lg-doc) em { font-style: italic; }
:where(.lg-doc) dfn { font-style: normal; font-weight: 600; color: var(--text); }
:where(.lg-doc) abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; }
:where(.lg-doc) time { font-variant-numeric: tabular-nums; }
:where(.lg-doc) code {
  font-size: 0.9em; padding: 1px 6px; border-radius: 6px;
  background: var(--lg-panel-2); border: 1px solid var(--border-faint); color: var(--text);
  overflow-wrap: anywhere;
}

/* Links and cross-references. */
:where(.lg-doc) a {
  color: var(--lg-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 92, 100, 0.45);
  overflow-wrap: anywhere;
}
:where(.lg-doc) a:hover { color: var(--text); text-decoration-color: currentColor; }
:where(.lg-doc) a[href^="mailto:"] { white-space: nowrap; }
@media (max-width: 380px) { :where(.lg-doc) a[href^="mailto:"] { white-space: normal; } }

/* Lists. The site's reset strips list markers; the document wants them. */
:where(.lg-doc) ul, :where(.lg-doc) ol { margin: 0 0 1.1em; padding-left: 1.45em; }
:where(.lg-doc) ul { list-style: disc; }
:where(.lg-doc) ol { list-style: decimal; }
:where(.lg-doc) ul ul { list-style: circle; }
:where(.lg-doc) li { margin: 0 0 0.5em; padding-left: 0.25em; }
:where(.lg-doc) li > ul, :where(.lg-doc) li > ol { margin-top: 0.5em; margin-bottom: 0.25em; }
:where(.lg-doc) li::marker { color: var(--lg-link); font-variant-numeric: tabular-nums; }
:where(.lg-doc) ol > li::marker { font-weight: 600; font-size: 0.92em; }
@counter-style lg-paren-alpha { system: extends lower-alpha; prefix: "("; suffix: ") "; }
@counter-style lg-paren-roman { system: extends lower-roman; prefix: "("; suffix: ") "; }
:where(.lg-doc) ol.lg-alpha { list-style: lg-paren-alpha; padding-left: 2.1em; }
:where(.lg-doc) ol.lg-roman { list-style: lg-paren-roman; padding-left: 2.4em; }
:where(.lg-doc) ul.lg-plain { list-style: none; padding-left: 0; }

/* ============================================================================
   5. PARTS, SECTIONS AND CLAUSES
   ============================================================================ */
/* A part groups sections ("Part 3 · Money"). It is a divider, not a heading. */
.lg-part {
  display: flex; align-items: center; gap: 14px;
  max-width: none !important;
  margin: clamp(56px, 7vw, 88px) 0 clamp(8px, 1vw, 12px);
  padding: 0;
  color: var(--lg-ink-3);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.lg-part__n { color: var(--lg-link); white-space: nowrap; }
.lg-part__t { color: var(--lg-ink-2); }
.lg-part::after { content: ""; flex: 1; min-width: 24px; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.lg-body > .lg-part:first-child { margin-top: 0; }

/* A numbered section. */
.lg-sec { padding-top: clamp(40px, 5vw, 56px); }
.lg-sec + .lg-sec { margin-top: clamp(8px, 1vw, 16px); border-top: 1px solid var(--border-faint); }
.lg-part + .lg-sec { padding-top: clamp(20px, 2.5vw, 28px); }
.lg-body > .lg-sec:first-child { padding-top: 0; }

.lg-sec > h2, .lg-hw > h2 {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 14px; align-items: start;
  margin: 0 0 var(--space-5);
  color: var(--text);
  font-size: clamp(1.32rem, 1.05rem + 1.05vw, 1.72rem);
  line-height: 1.25; letter-spacing: -0.022em; font-weight: 700;
  overflow-wrap: anywhere;
}
.lg-sec h2 > .lg-num {
  display: inline-grid; place-items: center;
  min-width: 2.1em; height: 2.1em; padding: 0 0.45em;
  margin-top: -0.28em;
  border: 1px solid var(--lg-red-line); border-radius: 11px;
  background: var(--lg-red-soft);
  color: #FF8A90;
  font-size: 0.66em; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* A numbered clause with a title. */
.lg-doc h3 {
  margin: 2.1em 0 0.7em;
  color: var(--text);
  font-size: clamp(1.04rem, 1rem + 0.25vw, 1.14rem);
  line-height: 1.4; letter-spacing: -0.012em; font-weight: 600;
  overflow-wrap: anywhere;
  max-width: var(--lg-measure);
}
.lg-doc h3 > .lg-num {
  display: inline-block; min-width: 2.25em; margin-right: 0.4em;
  color: #FF8A90; font-weight: 600; font-variant-numeric: tabular-nums;
}
.lg-doc h4 {
  margin: 1.6em 0 0.5em; color: var(--text); font-size: 1rem; font-weight: 600; letter-spacing: -0.005em;
}
/* The first clause straight under the In-short box needs less air. */
.lg-short + h3, .lg-short + .lg-hw > h3 { margin-top: 1.4em; }

/* A numbered paragraph (third level: 12.4.1 under clause 12.4). On a wide
   sheet the number hangs in the margin; on a phone it leads the line. */
.lg-doc p.lg-clause { position: relative; }
.lg-clause > .lg-num {
  color: #FF8A90; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 0.4em;
}
@media (min-width: 1000px) {
  .lg-doc p.lg-clause { padding-left: 3.6em; }
  .lg-clause > .lg-num { position: absolute; left: 0; top: 0; margin: 0; font-size: 0.92em; line-height: calc(var(--lg-line) / 0.92 * 1em); }
}

/* Where a link lands, show it for a moment. */
@keyframes lg-flash { 0% { background-color: rgba(251, 44, 54, 0.22); } 100% { background-color: transparent; } }
.lg-doc :is(h2, h3, h4, p, li, .lg-def):target,
.lg-doc :is(h2, h3, h4, p, li, .lg-def):has(> .lg-alias:target),
.lg-doc .lg-hw:has(> :target) > :is(h2, h3) {
  animation: lg-flash 2.6s var(--ease) 0.15s both;
  border-radius: 8px;
}
.lg-alias { display: inline; }   /* an extra anchor: empty, invisible, exact */

/* ---- Copy link on a heading (the button is drawn by legal.js) ---- */
.lg-hw { position: relative; }
.lg-copy {
  position: absolute; top: 0; right: -6px;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--lg-ink-3); background: transparent;
  opacity: 0; transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.lg-copy svg { width: 16px; height: 16px; }
.lg-hw > h2 { padding-right: 36px; }
.lg-hw > h3 { padding-right: 36px; }
.lg-hw > h3 + .lg-copy { top: -3px; }
.lg-hw:hover > .lg-copy, .lg-copy:focus-visible, .lg-copy.is-done { opacity: 1; }
.lg-copy:hover { color: var(--text); background: var(--lg-panel-2); }
.lg-copy.is-done { color: var(--success); }
@media (min-width: 1000px) {
  .lg-hw > h2, .lg-hw > h3 { padding-right: 0; }
  .lg-copy { right: auto; left: -40px; }
  .lg-hw > h2 + .lg-copy { top: 2px; }
}
@media (hover: none), (pointer: coarse) {
  /* A 44px target on touch (it was 40px); the heading keeps its room. */
  .lg-copy { opacity: 0.6; width: 44px; height: 44px; right: -12px; }
  .lg-hw > h2 + .lg-copy { top: -4px; }
  .lg-hw > h3 + .lg-copy { top: -9px; }
}
@media (min-width: 1000px) and (hover: none), (min-width: 1000px) and (pointer: coarse) {
  .lg-copy { right: auto; left: -48px; }
}

/* ============================================================================
   6. IN SHORT — the non-binding summary that opens each section
   ============================================================================ */
.lg-short {
  position: relative;
  margin: 0 0 1.6em;
  padding: 16px 18px 16px 20px;
  border-radius: var(--lg-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border);
  overflow: hidden;
}
.lg-short::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--red), rgba(251, 44, 54, 0.2));
}
.lg-short .lg-short__k {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin: 0 0 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text);
}
.lg-short .lg-short__nb {
  font-size: 0.78rem; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--lg-ink-3);
}
.lg-short p { color: var(--lg-ink); margin: 0; }
.lg-short p + p { margin-top: 0.6em; }

/* ============================================================================
   7. DEFINITIONS
   ============================================================================ */
.lg-defs {
  margin: 0 0 1.4em;
  border: 1px solid var(--border); border-radius: var(--lg-radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}
.lg-def {
  display: grid; grid-template-columns: minmax(8.5rem, 12rem) minmax(0, 1fr); gap: 4px 22px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-faint);
}
.lg-def:first-child { border-top: 0; }
.lg-def dt { color: var(--text); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.lg-def dd { color: var(--lg-ink-2); line-height: 1.68; min-width: 0; }
.lg-def dd p { margin: 0 0 0.6em; }
.lg-def dd > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .lg-def { grid-template-columns: minmax(0, 1fr); padding: 13px 14px; }
}

/* ============================================================================
   8. CALLOUTS — used sparingly
   ============================================================================ */
.lg-callout {
  --lg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 16.5v-5M12 8h.01'/%3E%3C/svg%3E");
  position: relative;
  margin: 1.4em 0;
  padding: 15px 18px 15px 50px;
  border: 1px solid var(--border); border-radius: var(--lg-radius);
  background: var(--lg-panel);
}
.lg-callout::before {
  content: ""; position: absolute; left: 17px; top: 17px; width: 20px; height: 20px;
  background: var(--lg-ink-3);
  -webkit-mask: var(--lg-icon) center / contain no-repeat; mask: var(--lg-icon) center / contain no-repeat;
}
.lg-callout p { margin: 0; color: var(--lg-ink); }
.lg-callout p + p, .lg-callout p + ul, .lg-callout ul + p { margin-top: 0.6em; }
.lg-callout ul, .lg-callout ol { margin: 0.5em 0 0; }
/* Important: a term that decides who bears a loss, or that a reader would be
   surprised by later. */
.lg-callout--key {
  --lg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.6 2.4 20h19.2z'/%3E%3Cpath d='M12 10v4.4M12 17.2h.01'/%3E%3C/svg%3E");
  border-color: var(--lg-red-line);
  background: linear-gradient(100deg, rgba(251, 44, 54, 0.09), rgba(251, 44, 54, 0.025) 65%);
}
.lg-callout--key::before { background: var(--red); }
/* Conspicuous: the clause itself, set in heavier contrasting type inside a
   ruled box, where the law expects a term to stand out (warranty disclaimers,
   limitation of liability). Not capitals: bold contrasting type meets the
   requirement and stays readable. */
.lg-callout--conspicuous {
  padding: 18px 20px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-left: 4px solid var(--red);
  background: rgba(255, 255, 255, 0.045);
}
.lg-callout--conspicuous::before { display: none; }
.lg-callout--conspicuous p, .lg-callout--conspicuous li { color: var(--text); font-weight: 600; }
@media (max-width: 380px) {
  .lg-callout { padding: 46px 14px 14px; }
  .lg-callout::before { left: 14px; top: 15px; }
  .lg-callout--conspicuous { padding: 14px; }
}

/* ============================================================================
   9. TABLES — a table on wide screens, a stack of cards on a phone
   ============================================================================ */
.lg-tblwrap {
  margin: 1.4em 0;
  border: 1px solid var(--border); border-radius: var(--lg-radius);
  overflow-x: auto; overscroll-behavior-x: contain;
  background: rgba(255, 255, 255, 0.015);
}
.lg-tbl { width: 100%; border-collapse: collapse; font-size: 0.93em; line-height: 1.6; }
.lg-tbl caption {
  caption-side: top; text-align: left;
  padding: 13px 16px 11px; border-bottom: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 0.95em;
}
.lg-tbl th, .lg-tbl td { text-align: left; vertical-align: top; padding: 12px 14px; border-top: 1px solid var(--border-faint); }
/* Column headers may wrap: four unbreakable upper-case headers made a four-column
   table wider than the reading column between 768px and 1360px (QA, 14 Oct). */
.lg-tbl thead th {
  border-top: 0; background: rgba(255, 255, 255, 0.03);
  color: var(--lg-ink-3); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  hyphens: manual; overflow-wrap: normal;
}
.lg-tbl tbody th { color: var(--text); font-weight: 600; min-width: 7rem; }
.lg-tbl td { color: var(--lg-ink-2); min-width: 6rem; }
.lg-tbl td > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .lg-tblwrap { overflow: visible; border: 0; background: none; border-radius: 0; }
  .lg-tbl, .lg-tbl tbody, .lg-tbl tr, .lg-tbl th, .lg-tbl td { display: block; width: auto; }
  .lg-tbl caption { display: block; padding: 0 0 10px; border: 0; }
  .lg-tbl thead { display: none; }
  .lg-tbl tbody tr {
    margin: 0 0 10px; padding: 14px 15px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--lg-panel);
  }
  .lg-tbl tbody tr:last-child { margin-bottom: 0; }
  .lg-tbl th, .lg-tbl td { padding: 0; border: 0; min-width: 0; }
  .lg-tbl tbody th { font-size: 1.02em; padding-bottom: 2px; }
  .lg-tbl td { margin-top: 10px; }
  .lg-tbl td[data-th]::before, .lg-tbl tbody th[data-th]::before {
    content: attr(data-th);
    display: block; margin-bottom: 1px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--lg-ink-3);
  }
  .lg-tbl tbody th[data-th]::before { display: none; }   /* the row title needs no label */
}

/* ============================================================================
   10. ADDITIONAL CLAUSES (published from the admin console, loaded by legal.js)
   ============================================================================ */
.lg-extra { display: grid; gap: 12px; margin: 1.2em 0 0; max-width: var(--lg-measure); }
.lg-extra[hidden] { display: none; }
.lg-extra__item {
  padding: 18px 20px; border-radius: var(--lg-radius);
  border: 1px solid var(--border); background: var(--lg-panel);
}
.lg-extra__item h3 { margin-top: 0 !important; }
.lg-extra__date {
  display: inline-block; margin: -2px 0 10px; padding: 2px 10px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-faint); background: var(--lg-panel-2);
  color: var(--lg-ink-3); font-size: 0.76rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.lg-extra__item > :last-child { margin-bottom: 0; }
.lg-extra__empty { color: var(--lg-ink-3); font-style: italic; }
.lg-extra__empty[hidden] { display: none; }

/* ============================================================================
   11. CONTACT CARDS
   ============================================================================ */
.lg-contacts {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  margin: 1.2em 0 1.4em; max-width: var(--lg-measure);
}
.lg-contact {
  padding: 16px 18px; border-radius: var(--lg-radius);
  border: 1px solid var(--border); background: var(--lg-panel);
  min-width: 0;
}
.lg-contact .lg-contact__k {
  margin: 0 0 4px; color: var(--lg-ink-3);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.lg-contact .lg-contact__v { margin: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.lg-contact .lg-contact__v a { white-space: normal; }
/* s7: an address standing on its own line (a contact card, a table cell that holds
   only "Section 4.4") is a target, not a word in a sentence: its box stays where the
   words are and an invisible ::after makes the tap area 44px tall (a 21px line
   + 2 x 12). The 12px it reaches above and below lies over the card's padding and
   the cell's (on a phone, the 10px between a stacked row's lines): never over
   another link, as a cell or a card holds one. legal.js marks such a link
   .lg-lone when it is all of its cell or line: a link inside a sentence ("Is
   paid the fee (section 6.7)") keeps its own box, so a wrapped one's area never
   covers the plain words around it. */
.lg-tbl td > a.lg-lone, .lg-contact .lg-contact__v > a.lg-lone { position: relative; }
.lg-tbl td > a.lg-lone::after, .lg-contact .lg-contact__v > a.lg-lone::after { content: ""; position: absolute; inset: -12px 0; }
.lg-contact .lg-contact__note { margin: 6px 0 0; font-size: 0.9em; line-height: 1.6; color: var(--lg-ink-2); }

/* The closing line of the document. */
.lg-end {
  margin-top: clamp(40px, 5vw, 56px); padding-top: 20px;
  border-top: 1px solid var(--border-faint);
  color: var(--lg-ink-3); font-size: 0.88rem;
}

/* ============================================================================
   12. THE CONTENTS RAIL (wide screens) — also the drawer on a phone
   ============================================================================ */
.lg-rail { min-width: 0; }
.lg-rail__in {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 18px;
  background: rgba(9, 10, 15, 0.82);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
@media (min-width: 1000px) {
  .lg-rail { position: sticky; top: calc(var(--lg-top) + 20px); }
  .lg-rail__in { max-height: calc(100vh - var(--lg-top) - 40px); max-height: calc(100dvh - var(--lg-top) - 40px); }
  .lg-rail__close { display: none !important; }
}
.lg-rail__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 16px 10px;
}
.lg-rail__title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.lg-rail__pct { font-size: 0.75rem; font-weight: 600; color: var(--lg-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-rail__meter { height: 2px; margin: 0 16px 12px; border-radius: 2px; background: var(--border-faint); overflow: hidden; }
.lg-rail__meter i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad-bright); }
.lg-rail__close {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -8px -8px -8px 0;
  border-radius: 10px; color: var(--lg-ink-2);
}
.lg-rail__close:hover { background: var(--lg-panel-2); color: var(--text); }
.lg-rail__close svg { width: 20px; height: 20px; }

/* ---- Search within the document ---- */
.lg-find { position: relative; margin: 0 12px 10px; }
.lg-find__in {
  width: 100%; height: 40px; padding: 0 12px 0 36px;
  border: 1px solid var(--border); border-radius: 11px;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font-size: 0.88rem;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.lg-find:has(.lg-find__ctl:not([hidden])) .lg-find__in { padding-right: 76px; }
.lg-find__in::placeholder { color: var(--lg-ink-3); opacity: 1; }
.lg-find__in::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.lg-find__in:focus { outline: none; border-color: var(--lg-red-line); background: rgba(255, 255, 255, 0.06); box-shadow: var(--ring); border-radius: 11px; }
.lg-find__icon { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: var(--lg-ink-3); pointer-events: none; }
.lg-find__ctl { position: absolute; right: 4px; top: 4px; display: flex; gap: 2px; }
.lg-find__ctl[hidden] { display: none; }
.lg-find__btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--lg-ink-2);
}
.lg-find__btn:hover { color: var(--text); background: var(--lg-panel-2); }
.lg-find__btn:disabled { opacity: 0.35; cursor: default; background: none; }
.lg-find__btn svg { width: 16px; height: 16px; }
.lg-find__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px 0 4px; font-size: 0.76rem; color: var(--lg-ink-3); font-variant-numeric: tabular-nums; }
.lg-find__row[hidden] { display: none; }
.lg-find__clear { padding: 4px 8px; border-radius: 7px; color: var(--lg-ink-2); font-size: 0.76rem; font-weight: 600; }
.lg-find__clear:hover { color: var(--text); background: var(--lg-panel-2); }
@media (pointer: coarse) { .lg-find__in { font-size: max(16px, 1em); height: 44px; } .lg-find__icon { top: 13px; } .lg-find__ctl { top: 6px; } }

/* Search hits in the document. */
.lg-doc mark.lg-hit {
  background: rgba(251, 44, 54, 0.26); color: var(--text); -webkit-text-fill-color: var(--text);
  border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px rgba(251, 44, 54, 0.25);
}
.lg-doc mark.lg-hit.is-cur { background: #FB2C36; color: #fff; -webkit-text-fill-color: #fff; box-shadow: 0 0 0 2px rgba(251, 44, 54, 0.45); }

/* ---- The list of sections ---- */
.lg-toc {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 8px 14px;
  border-top: 1px solid var(--border-faint);
  scrollbar-width: thin;
}
.lg-toc ol { list-style: none; margin: 0; padding: 0; }
.lg-toc__grp { margin-top: 10px; }
.lg-toc__part {
  display: block; padding: 10px 10px 4px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--lg-ink-3);
}
.lg-toc__a {
  position: relative;
  display: grid; grid-template-columns: 1.9em minmax(0, 1fr) auto; gap: 6px; align-items: baseline;
  padding: 6px 10px; border-radius: 9px;
  color: var(--lg-ink-2); font-size: 0.85rem; line-height: 1.4; font-weight: 500;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.lg-toc__a::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
  background: var(--red); transform: scaleY(0); transition: transform var(--dur) var(--ease);
}
.lg-toc__n { color: var(--lg-ink-3); font-size: 0.74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lg-toc__n:empty::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: var(--red); vertical-align: 0.1em; }
.lg-toc__t { overflow-wrap: anywhere; }
.lg-toc__hits {
  min-width: 1.6em; padding: 0 6px; border-radius: var(--radius-pill);
  background: rgba(251, 44, 54, 0.18); color: #FFC2C5;
  font-size: 0.7rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.lg-toc__hits:empty { display: none; }
.lg-toc__a:hover { color: var(--text); background: var(--lg-panel-2); }
.lg-toc__a.is-read .lg-toc__n { color: rgba(255, 138, 144, 0.75); }
.lg-toc__a.is-active { color: var(--text); background: rgba(251, 44, 54, 0.1); font-weight: 600; }
.lg-toc__a.is-active::before { transform: scaleY(1); }
.lg-toc__a.is-active .lg-toc__n { color: #FF8A90; }
/* While searching, the list shows only the sections with a match. */
.lg-toc.is-filtering li:not(.has-hit) { display: none; }
.lg-toc.is-filtering .lg-toc__grp:not(.has-hit) { display: none; }
.lg-toc__none { padding: 14px 10px; font-size: 0.85rem; color: var(--lg-ink-3); }
.lg-toc__none[hidden] { display: none; }

/* ---- The phone contents bar ---- */
.lg-mbar { display: none; }
@media (max-width: 999.98px) {
  .lg-mbar {
    display: block;
    position: sticky; top: var(--lg-top); z-index: 60;
    height: var(--lg-mbar-h);
    background: rgba(6, 7, 11, 0.9);
    -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%);
    border-bottom: 1px solid var(--border);
    transition: opacity var(--dur) var(--ease), visibility 0s;
  }
  /* Past the end of the document the bar steps aside for the site footer. */
  .lg-mbar.is-past { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur); }
  .lg-mbar__row { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 calc(var(--lg-gutter) - 8px); max-width: 860px; margin: 0 auto; }
  .lg-mbar__btn {
    flex: 1 1 auto; min-width: 0; height: 42px;
    display: flex; align-items: center; gap: 10px; padding: 0 8px;
    border-radius: 10px; text-align: left; color: var(--text);
  }
  .lg-mbar__btn:hover { background: var(--lg-panel); }
  .lg-mbar__btn svg { flex: none; width: 20px; height: 20px; color: var(--lg-link); }
  .lg-mbar__lbl { flex: none; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
  .lg-mbar__cur {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 0.84rem; color: var(--lg-ink-2);
    padding-left: 10px; border-left: 1px solid var(--border);
  }
  .lg-mbar__pct { flex: none; font-size: 0.75rem; font-weight: 600; color: var(--lg-ink-3); font-variant-numeric: tabular-nums; }
  .lg-mbar__meter { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
  .lg-mbar__meter i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad-bright); }
  /* While stepping through search hits, the bar carries the controls. */
  .lg-mbar__find { display: none; flex: none; align-items: center; gap: 2px; }
  .lg-mbar.is-finding .lg-mbar__find { display: flex; }
  .lg-mbar.is-finding .lg-mbar__pct, .lg-mbar.is-finding .lg-mbar__lbl { display: none; }
  .lg-mbar__count { padding: 0 6px; font-size: 0.78rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .lg-mbar__ib { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--lg-ink-2); }
  .lg-mbar__ib:hover { background: var(--lg-panel); color: var(--text); }
  .lg-mbar__ib svg { width: 18px; height: 18px; }

  /* The rail becomes a drawer from the left. */
  .lg-rail {
    position: fixed; z-index: 130; top: 0; bottom: 0; left: 0;
    width: min(23rem, calc(100vw - 44px));
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: #0a0b10;
    border-right: 1px solid var(--border-strong);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.6);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0s linear 0.32s;
  }
  .lg-rail.is-open { transform: none; visibility: visible; transition: transform 0.32s var(--ease), visibility 0s; }
  .lg-rail__in { height: 100%; border: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg-rail__head { padding: 16px 16px 10px 18px; }
  .lg-toc__a { padding: 9px 10px; font-size: 0.92rem; }
  .lg-scrim {
    position: fixed; inset: 0; z-index: 129;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  .lg-scrim.is-on { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
}
@media (min-width: 1000px) { .lg-scrim { display: none; } }

/* ============================================================================
   13. "IN THIS SECTION" (very wide screens)
   ============================================================================ */
.lg-side { position: sticky; top: calc(var(--lg-top) + 20px); min-width: 0; }
.lg-side__in { max-height: calc(100vh - var(--lg-top) - 40px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 12px; scrollbar-width: thin; }
.lg-side__k { margin: 6px 10px 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--lg-ink-3); }
.lg-side__sec { margin: 0 10px 10px; font-size: 0.86rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.lg-side ol { list-style: none; margin: 0 0 18px; padding: 0 0 0 10px; border-left: 1px solid var(--border); }
.lg-side li { margin: 0; }
.lg-side ol a {
  position: relative; display: block; padding: 5px 10px; margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--lg-ink-3); font-size: 0.8rem; line-height: 1.45;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.lg-side ol a:hover { color: var(--text); }
.lg-side ol a.is-active { color: var(--text); border-left-color: var(--red); }
.lg-side ol a b { font-weight: 600; color: inherit; font-variant-numeric: tabular-nums; margin-right: 4px; }
.lg-side__tools { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border-faint); }
.lg-tool {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 9px; text-align: left;
  color: var(--lg-ink-2); font-size: 0.82rem; font-weight: 500;
}
.lg-tool:hover { color: var(--text); background: var(--lg-panel-2); }
.lg-tool svg { flex: none; width: 16px; height: 16px; color: var(--lg-ink-3); }
.lg-tool.is-done, .lg-tool.is-done svg { color: var(--success); }

/* ============================================================================
   14. BACK TO TOP
   ============================================================================ */
.lg-fab {
  position: fixed; z-index: 70;
  right: calc(20px + var(--dock-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--dock-bottom, 0px));
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: rgba(10, 11, 16, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur), border-color var(--dur-fast) ease;
}
.lg-fab.is-on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s, border-color var(--dur-fast) ease; }
.lg-fab:hover { border-color: var(--red); }
.lg-fab svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .lg-fab { right: calc(14px + var(--dock-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px) + var(--dock-bottom, 0px)); }
}

/* The polite announcer for "Link copied" and search counts, when the site's
   notice card is not available. */
.lg-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Without the script the page's <noscript> style hides what needs it (the
   phone bar, the search, the side rail, back to top); the contents list stays,
   because it is plain links. */

/* ============================================================================
   15. MOTION, CONTRAST MODES
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  .lg-rail, .lg-rail.is-open, .lg-scrim, .lg-scrim.is-on, .lg-fab, .lg-fab.is-on, .lg-mbar, .lg-mbar.is-past, .lg-toc__a::before { transition: none; }
  .lg-doc :is(h2, h3, h4, p, li, .lg-def):target,
  .lg-doc :is(h2, h3, h4, p, li, .lg-def):has(> .lg-alias:target),
  .lg-doc .lg-hw:has(> :target) > :is(h2, h3) { animation: none; background-color: rgba(251, 44, 54, 0.12); }
}
@media (forced-colors: active) {
  .lg-short, .lg-callout, .lg-defs, .lg-tblwrap, .lg-contact, .lg-changes, .lg-extra__item, .lg-chip, .lg-rail__in { border: 1px solid CanvasText; }
  .lg-callout::before { background: CanvasText; forced-color-adjust: none; }
  .lg-toc__a.is-active { outline: 2px solid Highlight; }
  .lg-doc mark.lg-hit { forced-color-adjust: none; background: Mark; color: MarkText; }
}

/* ============================================================================
   16. PRINT — black on white, the document only, links spelled out
   ============================================================================ */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { padding: 0 !important; }
  body > :not(.lg) { display: none !important; }
  .lg { display: block !important; padding: 0 !important; max-width: none !important; }
  .lg > :not(.lg-main) { display: none !important; }
  .lg-doc {
    max-width: none !important; margin: 0 !important; padding: 0 !important;
    background: none !important; border: 0 !important; box-shadow: none !important;
    color: #000 !important; font-size: 10.5pt; line-height: 1.5;
  }
  .lg-doc * { color: #000 !important; background: none !important; box-shadow: none !important; text-shadow: none !important; -webkit-text-fill-color: #000 !important; }
  .lg-doc p, .lg-doc ul, .lg-doc ol, .lg-doc dl, .lg-doc .lg-tblwrap, .lg-doc .lg-callout, .lg-doc .lg-short, .lg-doc h3 { max-width: none !important; }
  .lg-hero::before { content: "Onflow Ads"; }
  .lg-hero h1 { font-size: 22pt; max-width: none; }
  .lg-chip, .lg-changes, .lg-short, .lg-callout, .lg-defs, .lg-tblwrap, .lg-contact, .lg-extra__item { border: 1px solid #999 !important; border-radius: 4px !important; }
  .lg-callout--key, .lg-callout--conspicuous { border: 1.5pt solid #000 !important; }
  .lg-short::before, .lg-callout::before, .lg-changes > h2::before, .lg-changes li::before, .lg-part::after { display: none !important; }
  .lg-callout { padding: 8pt 10pt !important; }
  .lg-changes ul { list-style: disc; padding-left: 1.2em; }
  .lg-changes li { padding-left: 0.2em; }
  .lg-sec h2 > .lg-num { border: 1px solid #000 !important; }
  .lg-doc li::marker { color: #000; }
  .lg-sec { break-before: auto; }
  .lg-doc h2, .lg-doc h3, .lg-doc h4, .lg-part { break-after: avoid-page; page-break-after: avoid; }
  .lg-short, .lg-callout, .lg-def, .lg-contact, .lg-extra__item, .lg-tbl tr, .lg-changes li { break-inside: avoid; page-break-inside: avoid; }
  .lg-doc p { orphans: 3; widows: 3; }
  .lg-copy, .lg-alias { display: none !important; }
  .lg-tblwrap { overflow: visible !important; }
  .lg-tbl thead { display: table-header-group !important; }
  .lg-doc a { text-decoration: underline !important; }
  .lg-doc a[href^="/"]::after { content: " (onflowads.com" attr(href) ")"; font-size: 0.85em; font-weight: 400; overflow-wrap: anywhere; }
  .lg-doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; font-weight: 400; overflow-wrap: anywhere; }
  .lg-doc mark.lg-hit { background: none !important; box-shadow: none !important; padding: 0; }
}
