html { scroll-behavior: smooth; }
.legal-shell { max-width: 1160px; margin: 0 auto; padding: 48px 24px 64px; }
.legal-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.legal-shell h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: 16px; overflow-wrap: anywhere; }
.legal-shell h2 { font-size: 23px; margin: 32px 0 12px; }
.legal-shell p, .legal-shell ul { margin-bottom: 16px; color: var(--text-soft); }
.legal-shell ul { padding-left: 24px; }
.legal-shell li { margin-bottom: 8px; }
.legal-shell a { overflow-wrap: anywhere; }
.legal-meta { color: var(--text-dim); }
.legal-details { padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
@media (max-width: 600px) { .legal-shell { padding: 28px 20px 40px; } .legal-details { padding: 18px; } }
.document-bar { max-width: 1160px; margin: auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.document-header .logo { flex-shrink: 0; }
.document-header .logo:hover { text-decoration: none; }
.document-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; padding: 0; }
.document-links a { padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--text-dim); min-height: 44px; display: flex; align-items: center; }
.document-links a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.document-links a.active { color: var(--primary-2); background: rgba(146,92,255,.14); }
.document-hero { padding: 12px 0 32px; margin-bottom: 40px; border-bottom: 1px solid var(--border); background: radial-gradient(ellipse at 10% 0, rgba(146,92,255,.08), transparent 65%); }
.document-hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; letter-spacing: -.035em; }
.document-badge { display: inline-block; color: var(--primary-2); font-size: 11px; font-weight: 700; letter-spacing: .12em; margin-bottom: 20px; }
.document-lead { font-size: 18px; line-height: 1.7; max-width: 640px; margin: 20px 0 12px; }
.document-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.document-toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
.document-toc summary { padding: 12px 0; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.document-toc ol { list-style: none; counter-reset: toc; padding: 8px 0; }
.document-toc li { margin: 0; counter-increment: toc; }
.document-toc a { display: flex; gap: 12px; padding: 10px 8px; font-size: 13px; color: var(--text-dim); border-radius: 8px; }
.document-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--primary-2); font-size: 11px; padding-top: 2px; }
.document-toc a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.document-content { min-width: 0; max-width: 820px; line-height: 1.7; }
.document-content h2 { margin: 0 0 16px; }
.legal-shell .document-callout { padding: 16px 20px; border: 1px solid rgba(146,92,255,.25); border-radius: 12px; color: var(--primary-2); background: rgba(146,92,255,.07); font-weight: 600; }
.document-section { padding: 0 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--border); scroll-margin-top: 110px; }
.document-section:last-child { margin-bottom: 0; border: 0; }
.document-faq { border-bottom: 1px solid var(--border); scroll-margin-top: 110px; }
.document-faq summary { list-style: none; cursor: pointer; padding: 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.document-faq summary::-webkit-details-marker { display: none; }
.document-faq summary::after { content: '+'; color: var(--primary-2); font-size: 24px; flex-shrink: 0; }
.document-faq[open] summary::after { content: '−'; }
.document-faq summary h2 { font-size: 17px; font-weight: 600; margin: 0; }
.document-faq[open] summary h2 { color: var(--primary-2); }
.document-faq .document-answer { padding-bottom: 12px; }
.document-help { margin-top: 56px; padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.document-help h2 { margin-top: 0; }
.document-back { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; margin-top: 20px; border: 1px solid var(--border-2); border-radius: 10px; color: var(--text); font-size: 14px; }
.document-back:hover { background: var(--surface-2); text-decoration: none; }
.document-footer { border-top: 1px solid var(--border); max-width: 1112px; margin: 0 auto; padding: 32px 24px; color: var(--text-dim); font-size: 13px; }
.document-footer strong { color: var(--text); font-size: 18px; }
.document-footer p { margin: 8px 0; }
.document-footer .document-links { margin: 12px -12px; }
.document-skip { position: fixed; top: 12px; left: 16px; z-index: 100; padding: 12px; background: var(--surface); border-radius: 8px; transform: translateY(-200%); }
.document-skip:focus { transform: translateY(0); }
.document-links a:focus-visible, .document-toc a:focus-visible, .document-back:focus-visible, .legal-shell summary:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 3px; }
@media (max-width: 800px) {
  .document-bar { flex-wrap: wrap; gap: 12px; padding: 14px 20px; }
  .document-header { position: static; }
  .document-bar .document-links { width: 100%; }
  .document-links a { padding: 8px 10px; }
  .legal-shell { padding: 28px 20px 40px; }
  .document-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .document-toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; }
  .document-hero { padding-bottom: 24px; margin-bottom: 28px; }
  .document-lead { font-size: 16px; }
  .legal-details, .document-help { padding: 20px; }
  .document-section, .document-faq { scroll-margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
