/* PayTP — reading-page styles for the whitepaper and formal spec.
   Loaded after site.css. Typeset like a paper: serif prose, a sticky section TOC,
   restrained chrome. Print-optimised. */

.doc-header { border-bottom: 1px solid var(--line); padding: 2.25rem 0 1.5rem; }
.doc-header .kicker { font-family: var(--mono); color: var(--dim); font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; font-size: .72rem; margin: 0 0 .6rem; }
.doc-header h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.1rem); font-weight: 600;
  margin: 0 0 .5rem; max-width: 26ch; letter-spacing: -.01em; }
.doc-header p { color: var(--dim); margin: 0; max-width: var(--readw); }
.doc-actions { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.1rem; align-items: center; }
.doc-banner { font-size: .82rem; color: var(--dim); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .6rem .85rem; margin-top: 1rem; max-width: var(--readw); }

.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem;
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 84px); overflow-y: auto;
  font-size: .84rem; padding-right: .5rem; }
.toc h2 { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dim); margin: 0 0 .6rem; font-weight: 600; }
.toc a { display: block; color: var(--dim); padding: .2rem 0; border-left: 1px solid transparent; padding-left: .7rem; text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.h3 { padding-left: 1.5rem; font-size: .8rem; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
/* collapsible chapters: sub-sections show only for the chapter being read */
.toc .toc-clink { color: var(--ink); font-weight: 600; }
.toc .toc-sub { display: none; margin-bottom: .25rem; }
.toc .toc-ch.active > .toc-sub { display: block; }
.toc .toc-sub a { padding-left: 1.6rem; font-size: .8rem; }
.toc .toc-sub a.h3 { padding-left: 2.4rem; }

.prose { max-width: var(--readw); min-width: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.68; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); letter-spacing: -.01em; }
.prose h1 { font-size: 1.6rem; margin: 2.6rem 0 1rem; padding-top: .6rem; font-weight: 600; }
.prose h1:first-child { margin-top: 0; }
.prose h2 { font-size: 1.28rem; margin: 2.1rem 0 .8rem; font-weight: 600; }
.prose h3 { font-size: 1.08rem; margin: 1.6rem 0 .5rem; font-weight: 600; }
.prose h4 { font-size: .98rem; margin: 1.3rem 0 .5rem; font-weight: 600; }
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose li > ul, .prose li > ol { margin: .35rem 0; }
.prose strong { font-weight: 600; color: var(--ink); }
/* Blockquotes are used as set-apart callout boxes (e.g. the front-matter Claims/Non-Claims note). */
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; background: var(--bg-2); color: var(--ink); font-size: .96rem; }
.prose blockquote > :last-child { margin-bottom: 0; }
/* Sequence diagrams: inlined SVG themed with var(--accent) + currentColor, so it
   follows the site accent and page text color (light/dark). Generous vertical room.
   On wide screens the figure breaks out past the text column so wide diagrams
   (e.g. the 4-lane two-leg flow) stay legible rather than shrinking. */
.prose .diagram { margin: 2.6rem 0; text-align: center; }
.prose .diagram svg { max-width: 100%; height: auto; }
@media (min-width: 1080px) {
  .prose .diagram { width: min(860px, 124%); margin-left: 50%; transform: translateX(-50%); }
}
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4rem 0; }
.prose code { font-family: var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px;
  padding: .05em .3em; font-size: .82em; overflow-wrap: anywhere; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
  overflow-x: auto; margin: 0 0 1.2rem; }
.prose pre code { background: none; border: none; padding: 0; font-size: .8rem; line-height: 1.55; }
.prose .tbl-scroll { margin: 0 0 1.3rem; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .86rem; min-width: 520px; }
.prose th, .prose td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--bg-2); font-weight: 600; }
.prose h1 a.anchor, .prose h2 a.anchor { opacity: 0; color: var(--dim); font-weight: 400; margin-left: .4rem;
  text-decoration: none; font-size: .7em; font-family: var(--mono); }
.prose h1:hover a.anchor, .prose h2:hover a.anchor { opacity: 1; }

@media (max-width: 880px) {
  .doc-layout { grid-template-columns: 1fr; gap: 1rem; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem 1.1rem; margin-bottom: 1rem; background: var(--bg-2); }
}

/* ---- print / PDF — typeset for an academic paper ---- */
@media print {
  .nav, .foot, .toc, .doc-actions, .doc-banner, .icon-btn, .skip { display: none !important; }
  .doc-layout { display: block; padding: 0; max-width: none; }
  body { color: #000; background: #fff; }

  /* Title block: prominent, stable size (no viewport-relative clamp in print). */
  .doc-header { padding: 0 0 1.4rem; margin-bottom: 1.8rem; border-bottom: 1px solid #000; }
  .doc-header h1 { font-size: 24pt; line-height: 1.15; max-width: none; }
  .doc-header .kicker { font-size: 9pt; }
  .doc-header p { font-size: 11pt; }

  /* Body: 12pt serif, generous leading, justified & hyphenated like a paper. */
  .prose { max-width: none; font-size: 12pt; line-height: 1.55; }
  .prose p, .prose li { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }

  /* Code and tables stay left-aligned, unhyphenated, and self-contained. */
  .prose pre, .prose code { background: #f4f4f4 !important; border-color: #ddd !important; }
  .prose pre { text-align: left; hyphens: none; font-size: 9.5pt; }
  .prose table { font-size: 10.5pt; }

  .prose h1, .prose h2, .prose h3, .prose h4 { page-break-after: avoid; }
  .prose pre, .prose table, .prose figure, .prose blockquote { page-break-inside: avoid; }
  .prose blockquote { background: #fff; border: 1px solid #000; border-left: 3px solid #000; padding: .7rem 1rem; }
  a { color: #000; text-decoration: none; }

  @page { size: A4; margin: 2.5cm; }
}
