/* ===== Legal document pages (28 Oct): #/terms, #/privacy, #/sms-terms, #/live-trader-agreement, #/live-program-rules and #/rewards-terms =====
   Markup: index.html .page--ldoc → .wrap.ldoc (the full documents from legal-content/*.pdf: the Terms of
   Service effective October 19, 2026, the Privacy Policy, the SMS Terms, the Live Trader Agreement, the Live Program Rules, the Rewards Wheel Official Rules). Behaviour: assets/js/legal-doc.js (section in
   view, contents list on phones), one instance per page.
   Layout follows the FAQ page: from 1024px a sticky contents list (.ldoc__nav, left) beside the reading
   column (.ldoc__doc, right); below 1024px the list is a collapsible "Contents" row above the document
   (a native <details>, so it works without the script). The look is the site's own light design: white
   page, hairline card, Strix blue for the section in view, dark ink for the text. */

/* .sub clips its sky with overflow: hidden, which would make it the scroll container for the sticky
   list (same fix as the FAQ page): clip clips without creating a scroll container. */
.page--ldoc .sub {
  background: #fff;
  overflow: clip;
}
.ldoc {
  /* the floating nav sits 24px down and is var(--nav-h) tall: everything that sticks or lands under it
     clears it by 16px (the same 100px as html { scroll-padding-top }) */
  --ldoc-top: calc(env(safe-area-inset-top, 0px) + var(--nav-h, 60px) + 24px + 16px);
  position: relative;
  z-index: 1;
}

/* ---- document head: title, company, the three lines under it ---- */
.sub .ldoc__co {
  margin: 18px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.sub .ldoc__meta {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.ldoc__eff {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lav);
  color: var(--blue-ink);
  font-weight: 600;
  font-size: 14px;
}

/* ---- two columns: contents | document ---- */
.ldoc__grid {
  display: grid;
  grid-template-columns: clamp(240px, 21vw, 284px) minmax(0, 1fr);
  gap: 24px 56px;
  align-items: start;
  margin-top: 36px;
}
.ldoc__nav {
  position: sticky;
  top: var(--ldoc-top);
  max-height: calc(100vh - var(--ldoc-top) - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.ldoc__pick {
  display: none;
}
/* the native marker is off everywhere; the phone row draws its own chevron */
.ldoc__pick::-webkit-details-marker {
  display: none;
}
.ldoc__panel {
  background: #fff;
  border: 1px solid var(--line-d);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 10px 40px rgba(20, 20, 120, 0.06);
}
.ldoc__side-h {
  margin: 8px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ldoc__toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ldoc__toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.ldoc__toc a:hover {
  background: var(--lav);
  color: var(--ink);
}
.ldoc__toc a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.ldoc__toc a.on,
.ldoc__toc a.on:hover {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.ldoc__n {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 0;
  border-radius: 999px;
  background: var(--lav);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.ldoc__toc a.on .ldoc__n {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---- the document ---- */
.ldoc__doc {
  max-width: 72ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}
.sub .ldoc__doc p {
  max-width: none;
  margin: 0 0 14px;
}
.sub .ldoc__doc p + p {
  margin-top: 0;
}
.sub .ldoc__intro {
  font-size: 17px;
  line-height: 1.6;
}
.ldoc__sec {
  scroll-margin-top: var(--ticker-h, 0px); /* html's 100px scroll-padding-top clears the floating nav; the promo ticker, when live, adds its height */
}
.sub .ldoc__doc h2 {
  margin: 40px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line-d);
  font-size: clamp(22px, 2.1vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}
.ldoc__lead {
  font-weight: 650;
  color: var(--ink);
}
/* lettered subsections (Privacy Policy sections 2 and 11) */
.sub .ldoc__doc h3 {
  margin: 26px 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  scroll-margin-top: var(--ticker-h, 0px);
}
/* short lists the documents set one item per line (what a verification can involve, what the broker needs) */
.sub .ldoc__doc ul.ldoc__list {
  margin: 0 0 14px;
  padding: 0 0 0 22px;
  list-style: disc;
}
.ldoc__list li {
  margin: 0 0 6px;
}
.ldoc__list li::marker {
  color: var(--blue);
}
/* consent statements quoted in the SMS Terms: indented and a touch smaller, as in the document */
.sub .ldoc__doc .ldoc__quote {
  margin: 0 0 14px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--lilac);
}
.sub .ldoc__doc .ldoc__quote p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.ldoc__doc a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ldoc__doc a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px;
}
/* signature block (Live Trader Agreement): the two parties side by side where there is room, the blank
   lines of the unsigned copy kept as text */
.ldoc__sigs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px 32px;
  margin-top: 6px;
}
.ldoc__sig {
  padding: 16px 18px 8px;
  border: 1px solid var(--line-d);
  border-radius: 14px;
  background: #fff;
}
.sub .ldoc__doc .ldoc__sig h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sub .ldoc__doc .ldoc__sig p {
  margin: 0 0 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
/* numbered clauses: the number and heading in bold, a hanging look through a little extra space between clauses */
.ldoc__clause {
  scroll-margin-top: var(--ticker-h, 0px);
}
/* ---- rulebook (Live Program Rules): numbered rules, unnumbered notes, lettered subclauses, figures ---- */
.ldoc__kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.ldoc__rule,
.ldoc__note {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0 14px;
  margin: 0 0 16px;
  scroll-margin-top: var(--ticker-h, 0px);
}
.ldoc__rn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.ldoc__rn b {
  font-weight: 700;
  color: var(--blue-ink);
}
.ldoc__rn i {
  margin-top: 3px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}
.ldoc__rule--read .ldoc__rbody {
  padding-left: 12px;
  border-left: 2px solid var(--orange);
}
.ldoc__note .ldoc__rn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 5px;
}
.ldoc__note .ldoc__rbody {
  padding-left: 12px;
  border-left: 2px solid var(--line-d);
}
.sub .ldoc__doc .ldoc__note p {
  font-size: 15px;
  color: var(--ink-2);
}
.sub .ldoc__doc .ldoc__rbody p {
  margin: 0 0 10px;
}
.sub .ldoc__doc .ldoc__rbody > :last-child {
  margin-bottom: 0;
}
.sub .ldoc__doc .ldoc__sub {
  margin: 0 0 10px;
  padding: 0 0 0 26px;
  list-style: lower-alpha;
}
.ldoc__sub li {
  margin: 0 0 6px;
  padding-left: 4px;
}
.ldoc__sub li::marker {
  color: var(--blue-ink);
  font-weight: 600;
}
.ldoc__strong {
  font-weight: 600;
  color: var(--ink);
}
.sub .ldoc__doc .ldoc__fn {
  font-size: 14px;
  color: var(--ink-2);
}
/* figures: a real table, scrolling inside its own box where the screen is narrower than the table */
.ldoc__tscroll {
  margin: 0 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line-d);
  border-radius: 12px;
  background: #fff;
}
.ldoc__table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
}
.ldoc__table th,
.ldoc__table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-d);
}
/* figures and times stay on one line; descriptive cells wrap so every column stays in view on a desktop */
.ldoc__table td:last-child,
.ldoc__table thead th {
  white-space: nowrap;
}
.ldoc__table td:last-child {
  max-width: 28ch;
  white-space: normal;
}
/* seven-column tables (Table 1 of the Live Program Rules): headings wrap and the cells sit tighter so
   every column fits the reading column from 1280px; narrower screens still scroll the box */
.ldoc__table:has(thead th:nth-child(7)) thead th {
  white-space: normal;
}
.ldoc__table:has(thead th:nth-child(7)) th,
.ldoc__table:has(thead th:nth-child(7)) td {
  padding: 9px 10px;
}
.ldoc__table:has(thead th:nth-child(7)) td {
  max-width: none;
  white-space: nowrap; /* the figures stay on one line; the headings take the wrapping */
}
.ldoc__table thead th {
  background: var(--lav);
  color: var(--ink);
  font-weight: 600;
}
.ldoc__table tbody th {
  font-weight: 600;
  color: var(--ink);
}
.ldoc__table tbody tr:last-child th,
.ldoc__table tbody tr:last-child td {
  border-bottom: 0;
}
/* defined terms: the term, its definition beneath */
.sub .ldoc__doc .ldoc__dl {
  margin: 0 0 14px;
}
.ldoc__dl dt {
  margin: 16px 0 4px;
  font-weight: 650;
  color: var(--ink);
}
.ldoc__dl dd {
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--lilac);
}
/* sweepstakes notice (Rewards Wheel Official Rules): the no-purchase statement and the jurisdiction line,
   set apart in a hairline box above the document */
.ldoc__notice {
  margin: 22px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line-d);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  background: #fff;
  max-width: 72ch;
}
.sub .ldoc__notice p {
  margin: 0;
  max-width: none;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.sub .ldoc__notice p + p {
  margin-top: 4px;
  color: var(--ink-2);
}
/* section 4: the defined terms, one per row, the term in bold */
.ldoc__defs {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.ldoc__defs li {
  margin: 0 0 10px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--lilac);
}
.ldoc__term {
  font-weight: 650;
  color: var(--ink);
}

/* ---- tablet and phones: one column, the contents list collapses into a row above the text ---- */
@media (max-width: 1023px) {
  .ldoc__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-top: 28px;
  }
  .ldoc__nav {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    z-index: 5;
  }
  .ldoc .ldoc__pick {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box; /* a summary is sized content-box by default: 52px tall including the padding */
    width: 100%;
    max-width: 720px;
    min-height: 52px;
    padding: 12px 14px 12px 18px;
    border-radius: 999px;
    border: 1.5px solid #c9ccef;
    background: #fff;
    box-shadow: 0 4px 18px rgba(20, 20, 120, 0.05);
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      border-color 0.15s,
      box-shadow 0.15s;
  }
  .ldoc .ldoc__pick:hover {
    border-color: #a9aee6;
  }
  .ldoc .ldoc__pick:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(43, 43, 245, 0.2);
  }
  .ldoc__pick-l {
    flex: 1 1 auto;
    min-width: 0;
  }
  .ldoc__pick svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--blue);
    transition: transform 0.2s;
  }
  .ldoc__nav[open] .ldoc__pick {
    border-color: var(--blue);
  }
  .ldoc__nav[open] .ldoc__pick svg {
    transform: rotate(180deg);
  }
  .ldoc__panel {
    margin-top: 8px;
    max-width: 720px;
    max-height: min(62vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .ldoc__side-h {
    display: none;
  }
  /* mobile.css gives every li a an inline-block 44px tap box with negative margins (two classes beat one):
     the id keeps the flex row, the badge beside the title and a 44px row of its own */
  .ldoc .ldoc__toc a {
    display: flex;
    min-height: 44px;
    margin: 0;
    padding: 9px 10px;
    font-size: 15px;
  }
  .ldoc__doc {
    max-width: none;
  }
}
@media (max-width: 768px) {
  /* phones keep every line of text at 14px or more */
  .ldoc__rule,
  .ldoc__note {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0 10px;
  }
  /* mobile.css turns every .page table into a block scroller at this width; inside the legal document the
     box is the scroller, so the table stays a table and fills the box */
  .page--ldoc .ldoc__doc .ldoc__tscroll > table.ldoc__table {
    display: table;
    overflow: visible;
  }
  .ldoc__table th,
  .ldoc__table td {
    padding: 8px 10px;
  }
  .sub .ldoc__co,
  .sub .ldoc__doc .ldoc__sig h3 {
    font-size: 14px;
  }
  .sub .ldoc__doc h2 {
    margin-top: 32px;
    padding-top: 22px;
    font-size: 22px;
  }
  .sub .ldoc__intro {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ldoc__toc a,
  .ldoc .ldoc__pick,
  .ldoc__pick svg {
    transition: none;
  }
}
