/* Terms and Conditions and Privacy Policy (templates/legal/base_legal.html, terms.html, privacy.html):
   a page head with both documents, a table of contents that follows the reader (a sticky column on wide
   screens, a row of links under the header on phones) and readable prose. Prefix lg-. Tokens only. */

/* ---------- Page head ---------- */
.lg-hero { padding: 40px 0 32px; }
.lg-hero .s-crumbs { margin-bottom: 28px; }
.lg-hero-main { display: flex; align-items: flex-start; gap: 22px; }
.lg-hero-icon { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); color: var(--primary); }
.lg-hero-icon .s-ic { width: 30px; height: 30px; }
.lg-hero-words { min-width: 0; }
.lg-hero .s-lead { margin-top: 10px; }
.lg-updated { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; margin-top: 18px; padding: 0 14px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); font-size: 0.85rem; font-weight: 700; color: var(--ink-2); }
.lg-updated .s-ic { width: 16px; height: 16px; color: var(--primary); }
.lg-switch { margin-top: 32px; }

/* ---------- Layout ---------- */
.lg-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; align-items: start; padding-top: 56px; }
.lg-aside { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 8px; }
.lg-toc-title { margin: 0 0 10px 12px; font-size: 0.74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.lg-toc .lg-toc-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lg-toc-list a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-size: 0.9rem; font-weight: 600; line-height: 1.3; text-decoration: none !important; transition: background-color .15s, color .15s; }
.lg-toc-list a .s-ic { width: 16px; height: 16px; color: var(--ink-4); transition: color .15s; }
.lg-toc-list a:hover { background: var(--bg-soft); color: var(--ink); }
.lg-toc-list a:hover .s-ic { color: var(--ink-3); }
.lg-toc-list a[aria-current="true"] { background: var(--primary-soft); color: var(--primary); }
.lg-toc-list a[aria-current="true"] .s-ic { color: var(--primary); }
.lg-help { margin-top: 20px; padding: 16px 16px 18px; border-radius: var(--r); background: var(--bg-soft); border: 1px solid var(--line); font-size: 0.86rem; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.lg-help-t { font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.lg-help a { font-weight: 700; }

/* ---------- The document ---------- */
.lg-doc { min-width: 0; max-width: 780px; color: var(--ink-2); font-size: 1rem; line-height: 1.75; overflow-wrap: break-word; }
.lg-section { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.lg-section > * + * { margin-top: 14px; }
.lg-section-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.lg-section-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.lg-section-icon .s-ic { width: 22px; height: 22px; }
.lg-section-head h2 { color: var(--ink); font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.lg-section-head p { margin-top: 4px; color: var(--ink-3); font-size: 0.95rem; line-height: 1.5; }
.lg-section strong { color: var(--ink); font-weight: 700; }
.lg-section a, .lg-inline-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lg-section a:hover { text-decoration-thickness: 2px; }

.lg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ol.lg-list { counter-reset: lg-item; }
ol.lg-list > li { position: relative; padding-left: 44px; counter-increment: lg-item; }
ol.lg-list > li::before { content: counter(lg-item); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); font-size: 0.8rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
ul.lg-list > li { position: relative; padding-left: 26px; }
ul.lg-list > li::before { content: ""; position: absolute; left: 6px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.lg-sublist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.lg-sublist li { position: relative; padding-left: 20px; }
.lg-sublist li::before { content: ""; position: absolute; left: 4px; top: 0.8em; width: 8px; height: 2px; border-radius: 2px; background: var(--ink-4); }

.lg-callout { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-radius: var(--r); background: var(--warn-soft); border: 1px solid color-mix(in oklab, var(--warn) 26%, transparent); color: var(--ink-2); }
.lg-callout > .s-ic { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--warn); }
.lg-callout h3 { color: var(--ink); font-size: 1rem; font-weight: 800; line-height: 1.4; }
.lg-callout h3 + p { margin-top: 4px; }
.lg-callout-info { background: var(--primary-soft); border-color: var(--primary-line); }
.lg-callout-info > .s-ic { color: var(--primary); }
.lg-section > .lg-callout { margin: 4px 0 22px; }

.lg-contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.lg-section .lg-contact-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 0.9rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; transition: border-color .15s; }
.lg-section .lg-contact-links a:hover { border-color: var(--ink-3); }
.lg-contact-links .s-ic { width: 17px; height: 17px; color: var(--primary); }

.lg-confirm { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--ok-soft); border: 1px solid color-mix(in oklab, var(--ok) 26%, transparent); color: var(--ink); }
.lg-confirm > .s-ic { width: 26px; height: 26px; flex: none; color: var(--ok); }
.lg-confirm p { font-weight: 600; line-height: 1.65; }

/* ---------- Narrow screens: the contents become a row of links under the header ---------- */
@media (max-width: 960px) {
  .lg-layout { display: block; padding-top: 0; }
  .lg-aside { position: sticky; top: var(--header-h); z-index: 20; max-height: none; overflow: visible; margin: 0 calc(var(--gutter) * -1) 32px; padding: 0; background: color-mix(in oklab, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
  .lg-toc-title { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .lg-toc .lg-toc-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--gutter); }
  .lg-toc-list::-webkit-scrollbar { display: none; }
  .lg-toc-list li { flex: none; }
  .lg-toc-list a { min-height: 40px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; font-size: 0.86rem; }
  .lg-toc-list a .s-ic { display: none; }
  .lg-toc-list a[aria-current="true"] { border-color: var(--primary-line); }
  .lg-help { display: none; }
  .lg-section { scroll-margin-top: 72px; }
  .lg-doc { max-width: none; }
}
@media (max-width: 640px) {
  .lg-hero { padding: 28px 0 24px; }
  .lg-hero .s-crumbs { margin-bottom: 20px; }
  .lg-hero-main { flex-direction: column; gap: 16px; }
  .lg-hero-icon { width: 52px; height: 52px; border-radius: 14px; }
  .lg-hero-icon .s-ic { width: 26px; height: 26px; }
  .lg-switch { display: flex; width: 100%; margin-top: 24px; }
  .lg-switch .s-tab { flex: 1; justify-content: center; padding: 0 8px; font-size: 0.86rem; }
  .lg-switch .s-ic { display: none; }
  .lg-section { padding-bottom: 36px; margin-bottom: 36px; }
  .lg-section-head { gap: 14px; }
  .lg-section-icon { width: 40px; height: 40px; border-radius: 11px; }
  ol.lg-list > li { padding-left: 38px; }
  ol.lg-list > li::before { width: 26px; height: 26px; }
  .lg-callout, .lg-confirm { padding: 16px; gap: 12px; }
}

@media print {
  .s-header, .s-footer, .lg-aside, .lg-switch { display: none !important; }
  .lg-layout { display: block; padding-top: 0; }
  .lg-doc { max-width: none; color: #000; }
  .lg-section { break-inside: auto; }
}
