/* legal/*.html page styles. Owner: FIRM agent. Selectors prefixed .lg-. Long-form policy "documents":
   sticky contents rail with a reading-progress ledger ruler, clause numbers in the margin, print stylesheet. */
.lg-hero .phero__meta .badge { font-size: var(--fs-2xs); }
.lg-updated { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem; border: 1px solid var(--rule-strong); border-radius: 6px; color: var(--fg); background: rgba(111,209,165,.06); }
.lg-updated::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.lg-sec { padding-top: var(--section-y-tight); }

.lg-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7) clamp(2rem, 1rem + 3.5vw, 4.5rem); align-items: start; }
@media (min-width: 1100px) { .lg-layout { grid-template-columns: minmax(0, 3.3fr) minmax(0, 8.7fr); } .lg-rail { position: sticky; top: calc(var(--header-h) + 24px); } }
.lg-rail__in { display: grid; gap: 1.2rem; }
@media (min-width: 1100px) { .lg-rail__in { max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; overscroll-behavior: contain; padding-right: .3rem; scrollbar-width: thin; } }

/* progress: the ledger ruler */
.lg-prog { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .4rem .8rem; }
.lg-prog__k { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); }
.lg-prog__v { justify-self: end; font-size: var(--fs-xs); color: var(--green); font-variant-numeric: tabular-nums; }
.lg-prog__bar { grid-column: 1 / -1; position: relative; height: 12px; background:
  linear-gradient(var(--rule-strong) 0 0) 0 100% / 100% 1px no-repeat,
  repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 10%) 0 100% / 100% 6px no-repeat; }
.lg-prog__fill { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--green); transform-origin: left center; transform: scaleX(var(--p, 0)); }
html.no-js .lg-prog { display: none; }

.lg-toc { border-top: 3px double var(--rule-strong); }
.lg-toc__sum { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0 .5rem; list-style: none; cursor: default; }
.lg-toc__sum::-webkit-details-marker { display: none; }
.lg-rail__h { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); }
.lg-toc__count { font-size: var(--fs-2xs); color: var(--fg-3); padding: .15rem .45rem; border: 1px solid var(--rule); border-radius: var(--r-pill); }
.lg-toc__list { list-style: none; margin: 0; padding: 0 0 0 .9rem; position: relative; }
.lg-toc__list::before { content: ""; position: absolute; left: 0; top: .4rem; bottom: .4rem; width: 1px; background: var(--rule-strong); }
.lg-toc__a { position: relative; display: block; padding: .38rem 0 .38rem .6rem; color: var(--fg-2); font-size: var(--fs-sm); line-height: 1.4; text-decoration: none; border-radius: 4px; transition: color var(--dur-2); }
.lg-toc__a::before { content: ""; position: absolute; left: -.9rem; top: 50%; width: 9px; height: 1px; background: var(--rule-strong); transition: width var(--dur-3) var(--ease-out), background-color var(--dur-2); }
.lg-toc__a:hover { color: var(--fg); }
.lg-toc__a.is-read { color: var(--fg-3); }
.lg-toc__a.is-read::before { background: var(--green); }
.lg-toc__a.is-active { color: var(--green); font-weight: 600; }
.lg-toc__a.is-active::before { width: 16px; height: 2px; background: var(--green); }
.lg-toc__li--sub .lg-toc__a { padding-left: 1.3rem; font-size: var(--fs-xs); }
.lg-toc .lg-no { font-family: var(--font-mono); font-size: .85em; color: var(--fg-3); margin-right: .15em; }
.lg-toc__a.is-active .lg-no { color: inherit; }
.lg-print { justify-self: start; }
@media (max-width: 1099.98px) {
  .lg-rail { border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--surface); padding: .9rem 1rem; }
  .lg-toc { border-top: 1px solid var(--rule); }
  .lg-toc__sum { cursor: pointer; min-height: 44px; }
  .lg-toc__sum::after { content: ""; width: 9px; height: 9px; margin-left: auto; border-right: 1.5px solid var(--fg-2); border-bottom: 1.5px solid var(--fg-2); transform: rotate(45deg) translateY(-3px); transition: transform var(--dur-3) var(--ease-out); }
  .lg-toc[open] .lg-toc__sum::after { transform: rotate(225deg) translateY(-2px); }
  .lg-toc__count { margin-left: auto; }
  .lg-prog { display: none; }
}

/* the document sheet */
.lg-doc { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: clamp(1.4rem, .8rem + 3vw, 4rem) clamp(1.1rem, .5rem + 3.5vw, 4.5rem) clamp(1.6rem, 1rem + 2.5vw, 3rem) clamp(1.1rem, .4rem + 5vw, 6.5rem); }
.lg-doc::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(.6rem, .2rem + 3.2vw, 4.2rem); width: 3px; border-left: 1px solid var(--ledger-margin); border-right: 1px solid var(--ledger-margin); pointer-events: none; }
.lg-doc__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding-bottom: .9rem; margin-bottom: clamp(1.4rem, 1rem + 1.5vw, 2.4rem); border-bottom: 3px double var(--line-strong); font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.lg-prose { max-width: 70ch; font-size: var(--fs-md); line-height: 1.75; color: var(--text); }
.lg-prose > p:first-child { font-size: var(--fs-lead); line-height: 1.6; color: var(--text); }
.lg-prose h2 { position: relative; font-size: var(--fs-h4); letter-spacing: -.01em; margin-top: 2.4em; padding-top: 1.1em; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.lg-prose h3 { position: relative; font-size: var(--fs-h5); margin-top: 1.8em; scroll-margin-top: calc(var(--header-h) + 24px); }
.lg-prose .lg-no { font-family: var(--font-mono); font-weight: 500; font-size: .72em; color: var(--green); letter-spacing: .02em; }
@media (min-width: 700px) {
  .lg-prose h2 .lg-no { position: absolute; right: calc(100% + clamp(1.1rem, .6rem + 2.4vw, 3.4rem)); top: 1.55em; width: 3.2rem; text-align: right; font-size: var(--fs-xs); }
  .lg-prose h3 .lg-no { margin-right: .35em; }
}
.lg-prose h2.is-active .lg-no { color: var(--saffron); }
.lg-prose ul, .lg-prose ol { padding-left: 1.3em; }
.lg-prose li + li { margin-top: .4em; }
.lg-prose li::marker { color: var(--text-3); }
.lg-prose blockquote { margin-inline: 0; padding: .9rem 1.1rem; border-left: 3px solid var(--green); background: var(--paper); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2); }
.lg-prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.55; }
.lg-prose th, .lg-prose td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lg-prose thead th { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); font-weight: 500; background: var(--paper); border-bottom: 3px double var(--line-strong); }
.lg-prose .tbl-wrap, .lg-prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.lg-prose code { font-size: .86em; }
.lg-prose mark.todo { white-space: normal; }
.lg-doc__end { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); display: grid; gap: .8rem; font-size: var(--fs-xs); color: var(--text-3); }
.lg-doc__rule { display: block; height: 5px; border-top: 1px solid var(--text-2); border-bottom: 2px solid var(--text-2); opacity: .6; max-width: 70ch; }
.lg-doc__end .mono { letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-2xs); }

/* after the document: the set of policies + questions */
.lg-after { display: grid; gap: var(--space-6) clamp(2rem, 1rem + 3vw, 4rem); margin-top: clamp(3rem, 2rem + 3vw, 5rem); padding-top: var(--space-7); border-top: 3px double var(--rule-strong); }
@media (min-width: 1000px) { .lg-after { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.lg-after__h { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); margin-bottom: .8rem; }
.lg-set__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .5rem; }
.lg-set__a { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; min-height: 52px; padding: .6rem .9rem; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; transition: border-color var(--dur-2), background-color var(--dur-2); }
.lg-set__a:hover { border-color: var(--green); }
.lg-set__a[aria-current="page"] { border-color: var(--green); background: var(--success-bg); color: var(--success); }
.lg-set__n { font-size: var(--fs-2xs); color: var(--fg-3); }
.lg-set__a[aria-current="page"] .lg-set__n { color: inherit; }
.lg-doc, .lg-rail { min-width: 0; }
@media (max-width: 899.98px) { .lg-prose :not(.tbl-wrap) > table { display: block; overflow-x: auto; } .lg-prose pre { overflow-x: auto; } .lg-prose { overflow-wrap: anywhere; } }
.lg-set__here { font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; }
.lg-q { padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.8; }
.lg-q a { color: var(--link); overflow-wrap: anywhere; }

/* thin top progress bar (small screens, where the rail is not sticky) */
.lg-bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: calc(var(--z-header) + 1); pointer-events: none; }
.lg-bar span { display: block; height: 100%; background: var(--green); transform-origin: left center; transform: scaleX(var(--p, 0)); }
@media (min-width: 1100px) { .lg-bar { display: none; } }
html.no-js .lg-bar { display: none; }

/* print: the document only, black on white, URLs shown */
@media print {
  @page { margin: 18mm 16mm 20mm; }
  html, body { background: #fff !important; }
  .site-header, .site-footer, .wa-dock, .ledger-ruler, .lg-rail, .lg-after, .lg-bar, .skip-link, .phero__field, .crumbs, .phero .eyebrow, #goog-gt-tt, .skiptranslate { display: none !important; }
  .phero { padding: 0 0 8mm !important; background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
  .phero *, .lg-doc, .lg-doc * { color: #000 !important; }
  .phero__title { font-size: 22pt !important; }
  .phero__lead { font-size: 11pt !important; max-width: none !important; }
  .phero__meta { border-top: 1px solid #999 !important; font-size: 8.5pt !important; }
  .section.lg-sec { padding: 6mm 0 0 !important; background: #fff !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .lg-layout { display: block !important; }
  .lg-doc { border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }
  .lg-doc::before { display: none; }
  .lg-prose { max-width: none !important; font-size: 10.5pt !important; line-height: 1.55 !important; }
  .lg-prose > p:first-child { font-size: 11pt !important; }
  .lg-prose h2 { font-size: 13pt !important; break-after: avoid; page-break-after: avoid; border-top: 1px solid #999 !important; }
  .lg-prose h3 { font-size: 11pt !important; break-after: avoid; }
  .lg-prose h2 .lg-no { position: static !important; width: auto !important; font-size: inherit !important; }
  .lg-prose p, .lg-prose li { orphans: 3; widows: 3; }
  .lg-prose table, .lg-prose tr { break-inside: avoid; }
  .lg-prose a[href^="http"]::after, .lg-prose a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  .lg-prose a[href^="mailto"]::after { content: ""; }
  mark.todo { background: none !important; border: 1px dashed #000 !important; }
  [data-reveal], [data-split] { opacity: 1 !important; transform: none !important; }
}
