/* TERA OPTIONS — document pages (/learn, /risk, /terms, /privacy, /offer-terms, /how-prices-work). Requires tokens.css + components.css. */
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(49, 95, 234, 0.12), transparent 60%),
    var(--c-bg);
  color: #c4cfde;
}

.lg-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--s-5);
  height: 64px; padding: 0 var(--gutter);
  background: rgba(7, 17, 31, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.lg-top .brand { min-height: 44px; flex: none; }
.lg-nav { display: flex; gap: 2px; margin-left: var(--s-4); min-width: 0; }
.lg-nav a { color: var(--c-text-2); font-weight: 500; font-size: var(--fs-sm); padding: 6px 12px; border-radius: var(--r-sm); white-space: nowrap; }
.lg-nav a[aria-current="page"] { color: var(--c-text); background: var(--c-surface-2); }
.lg-back { margin-left: auto; flex: none; }

.lg-wrap {
  display: grid; grid-template-columns: 240px minmax(0, 740px); gap: var(--s-16); justify-content: center;
  padding: var(--s-12) var(--gutter) var(--s-20);
}
.lg-wrap.no-toc { grid-template-columns: minmax(0, 740px); }

.lg-toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; }
.lg-toc-title { font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-text-3); margin-bottom: var(--s-3); }
.lg-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border-left: 1px solid var(--c-border); }
.lg-toc a { display: block; color: var(--c-text-2); font-size: 13px; line-height: 1.4; padding: 6px 12px; margin-left: -1px; border-left: 1px solid transparent; }
@media (hover: hover) {
  .lg-nav a:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.04); text-decoration: none; }
  .lg-toc a:hover { color: var(--c-text); text-decoration: none; border-left-color: var(--c-cyan); }
}
.lg-nav a:active { background: rgba(255, 255, 255, 0.08); }
.lg-toc a:active { color: var(--c-text); border-left-color: var(--c-cyan); }

/* "On this page" for phones and tablets (the side list above is for wide screens) */
.lg-otp { display: none; }

.lg-doc { min-width: 0; font-size: var(--fs-md); line-height: 1.75; overflow-wrap: break-word; }
.lg-doc a { overflow-wrap: anywhere; }
.lg-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-caps); color: var(--c-cyan); margin-bottom: var(--s-2); }
.lg-doc h1 { margin: 0 0 var(--s-6); color: var(--c-text); font-family: var(--font-display); font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: 600; }
.lg-doc h2 { margin: var(--s-12) 0 var(--s-3); padding-top: var(--s-6); border-top: 1px solid var(--c-border); color: var(--c-text); font-family: var(--font-display); font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.lg-doc h3 { margin: var(--s-6) 0 var(--s-2); color: var(--c-text); font-size: 16px; line-height: 1.4; font-weight: 600; }
.lg-doc p { margin: 0 0 var(--s-4); }
.lg-doc strong { color: var(--c-text); font-weight: 600; }
.lg-doc ul, .lg-doc ol { margin: 0 0 var(--s-4); padding-left: var(--s-6); }
.lg-doc li { margin-bottom: var(--s-2); padding-left: 4px; }
.lg-doc li::marker { color: var(--c-text-3); }
.lg-doc hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-8) 0 var(--s-5); }
/* anything wider than the column (a long table or code line) scrolls inside itself, never the page */
.lg-doc table, .lg-doc pre { display: block; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.lg-meta { display: inline-block; max-width: 100%; font-size: var(--fs-sm); color: var(--c-text-2); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 10px 16px; line-height: 1.6; }
.lg-pending { color: var(--c-text-2); padding: var(--s-6); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }

.lg-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6);
  padding: var(--s-6) var(--gutter) var(--s-10); border-top: 1px solid var(--c-border); color: var(--c-text-3); font-size: var(--fs-xs);
}
.lg-foot nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.lg-foot a { color: var(--c-text-2); }

/* fingers: every link in the header, contents and footer gets a touch-sized hit area */
@media (pointer: coarse) {
  .lg-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; }
  .lg-foot nav { gap: 0 var(--s-5); }
  .lg-foot nav a { display: inline-flex; align-items: center; min-height: 40px; }
  .lg-doc a, .lg-foot a, .lg-otp summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}

/* below ~1000px the document links don't fit in the header (they are all in the footer) */
@media (max-width: 1000px) {
  .lg-nav { display: none; }
  .lg-wrap { grid-template-columns: minmax(0, 740px); gap: 0; padding-top: var(--s-8); }
  .lg-toc { display: none; }
  .lg-otp { display: block; margin-bottom: var(--s-8); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
  .lg-otp summary {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none;
    color: var(--c-text); font-size: 15px; font-weight: 600; border-radius: inherit;
  }
  .lg-otp summary::-webkit-details-marker { display: none; }
  .lg-otp summary span { margin-left: auto; color: var(--c-text-3); font-size: 13px; font-weight: 500; }
  .lg-otp summary::after {
    content: ''; flex: none; width: 8px; height: 8px; margin: -4px 2px 0 0;
    border-right: 2px solid var(--c-text-3); border-bottom: 2px solid var(--c-text-3); transform: rotate(45deg);
  }
  .lg-otp[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
  .lg-otp[open] summary { border-bottom: 1px solid var(--c-border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .lg-otp summary:active { background: rgba(148, 163, 184, 0.08); }
  .lg-otp summary:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: -2px; }
  .lg-otp ol { list-style: none; margin: 0; padding: 6px 0; }
  .lg-otp a { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; color: var(--c-text-2); font-size: 15px; line-height: 1.4; }
  .lg-otp a:active { color: var(--c-text); background: rgba(148, 163, 184, 0.1); text-decoration: none; }
}
@media (max-width: 760px) {
  .lg-top { gap: var(--s-3); }
  .lg-top .wordmark { font-size: 13px; }
}
/* phones: a 16px reading size, a smaller title and tighter section breaks */
@media (max-width: 560px) {
  .lg-wrap { padding-top: var(--s-6); padding-bottom: var(--s-12); }
  .lg-doc { font-size: 16px; line-height: 1.7; }
  .lg-doc h1 { font-size: clamp(26px, 8vw, 34px); margin-bottom: var(--s-5); }
  .lg-doc h2 { margin-top: var(--s-10); padding-top: var(--s-5); font-size: 20px; }
  .lg-doc ul, .lg-doc ol { padding-left: 20px; }
  .lg-foot { flex-direction: column; align-items: flex-start; gap: var(--s-3); padding-bottom: var(--s-8); }
  .lg-foot nav { font-size: var(--fs-sm); }
}
