/* Legal reading layout, using the same font, paper and approved brand tokens. */
.premium-page .signature-top:has(.signature-legal) { grid-template-columns: 1.35fr .64fr .8fr .8fr; }
.early-access-privacy { margin: 9px auto 0; font-size: 13px; }
.early-access-privacy a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.legal-page { --legal-top: 64px; --legal-ease: cubic-bezier(.24,.72,.31,1); }
.legal-header {
  position: sticky; z-index: 4; top: 0; min-height: var(--legal-top);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--sidebar); border-bottom: var(--hairline) solid var(--border);
}
.legal-back { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--muted); font-weight: 620; }
.legal-back:hover { color: var(--link); }
.legal-back svg, .legal-mobile-contents summary svg {
  flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 330ms var(--legal-ease);
}
.legal-back:hover svg { transform: translateX(-3px); }
.legal-progress { position: fixed; inset: calc(var(--legal-top) - 1px) 0 auto; z-index: 5; pointer-events: none; }
.legal-progress span { height: 2px; display: block; background: var(--accent); transform: scaleX(var(--read,0)); transform-origin: left; }
.legal-main { max-width: 1056px; }
.legal-title { padding: clamp(38px,7vw,94px) 0 0; }
.legal-title > p { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 620; font-size: 13px; }
.legal-title h1 {
  font-size: clamp(39px,6vw,78px); font-weight: 650; letter-spacing: -.073em;
  line-height: 1.02; max-width: 18ch; margin: 12px 0 28px; text-wrap: balance;
}
.legal-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; border-bottom: var(--hairline) solid var(--border); }
.legal-switcher a { position: relative; display:flex; align-items:center; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 620; }
.legal-switcher a[aria-current="page"] { color: var(--ink); }
.legal-switcher a:hover { color: var(--link); }
.legal-switcher a::after {
  position: absolute; content: ''; inset: auto 0 -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 390ms var(--legal-ease);
}
.legal-switcher a:is(:hover,[aria-current="page"],:focus-visible)::after { transform: scaleX(1); }
.legal-layout { display: grid; grid-template-columns: minmax(182px,.34fr) minmax(0,1fr); gap: clamp(22px,6vw,85px); padding: clamp(27px,5vw,68px) 0 clamp(58px,10vw,126px); }
.legal-index { min-width: 0; }
.legal-desktop-contents { position: sticky; top: calc(var(--legal-top) + 20px); max-height: calc(100dvh - var(--legal-top) - 38px); overflow: auto; scrollbar-width: thin; }
.legal-index ul { margin: 0; padding: 0; list-style: none; }
.legal-index h2 { font-size: 14px; font-weight: 680; padding: 0 0 10px 11px; }
.legal-index a {
  display:flex; align-items:center; min-height: 31px; padding: 3px 7px 3px 10px;
  border-inline-start: 1px solid var(--border); color: var(--muted);
  font-size: 13px; line-height: 1.27; transition: color 260ms, border-color 260ms, background 260ms;
}
.legal-index a:hover { color: var(--link); background: var(--row-hover); }
.legal-index a[aria-current="location"] { color: var(--link); border-inline-start-color: var(--accent); }
.legal-index a:focus-visible { outline-offset: -2px; }
.legal-mobile-contents { display: none; }
.legal-copy { max-width: 71ch; font-size: 16px; line-height: 1.67; }
.legal-clause { border-top: var(--hairline) solid var(--border); padding: 22px 0 26px; }
.legal-clause:first-child { border-top: 0; padding-top: 0; }
.legal-clause h2 {
  font-size: clamp(23px,3vw,32px); font-weight: 650; letter-spacing: -.043em; line-height: 1.17;
  scroll-margin-top: calc(var(--legal-top) + 24px); margin: 0 0 12px;
}
.legal-clause h3 { font-size: 16px; line-height: 1.35; margin: 18px 0 6px; }
.legal-clause p { margin-block: 0 12px; }
.legal-clause p:last-child { margin-bottom: 0; }
.legal-clause ul { margin: 0 0 13px; padding-inline-start: 23px; }
.legal-clause li { margin-bottom: 3px; }
.legal-clause a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-clause h2:focus:not(:focus-visible) { outline: 0; }
.legal-footer .signature-top { align-items: start; }
.legal-footer .signature-top p { margin-bottom: 0; }
.legal-title h1 { animation: legal-settle 720ms var(--legal-ease) both; }
.legal-title .legal-switcher { animation: legal-settle 630ms var(--legal-ease) 80ms both; }
@keyframes legal-settle {
  from { transform: translateY(7px); opacity: .46; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 750px) {
  .legal-title h1 { margin-bottom: 18px; }
  .legal-layout { grid-template-columns: 1fr; gap: 22px; }
  .legal-desktop-contents { display: none; }
  .legal-mobile-contents { display: block; border: var(--hairline) solid var(--border); border-radius: 7px; background: var(--paper); }
  .legal-mobile-contents summary { display:flex; justify-content:space-between; gap:8px; align-items:center; min-height: 44px; padding: 0 11px; cursor:pointer; font-weight: 650; list-style:none; }
  .legal-mobile-contents summary::-webkit-details-marker { display:none; }
  .legal-mobile-contents[open] summary svg { transform: rotate(180deg); }
  .legal-mobile-contents nav { padding: 4px 10px 10px; }
  .legal-mobile-contents a { min-height: 44px; font-size: 14px; }
  .premium-page .signature-top:has(.signature-legal) { grid-template-columns: 1fr 1fr; gap: 21px; }
}
@supports (interpolate-size: allow-keywords) {
  .legal-mobile-contents { interpolate-size: allow-keywords; }
  .legal-mobile-contents::details-content {
    block-size: 0; overflow: clip;
    transition: block-size 340ms var(--legal-ease), content-visibility 340ms allow-discrete;
  }
  .legal-mobile-contents[open]::details-content { block-size: auto; }
}
@media (max-width: 480px) {
  .legal-page { --legal-top: 56px; }
  .legal-switcher { gap: 1px 12px; }
  .legal-switcher a { font-size: 13px; }
  .premium-page .signature-top:has(.signature-legal) { grid-template-columns: 1fr; }
  .signature-top nav.signature-legal, .legal-footer .signature-top nav { flex-direction: column; gap: 8px; }
}
.legal-mobile-contents[data-jumping]::details-content { transition: none; }
