/* Appendix — source behind the claims.
   Each entry pairs a claim with the file that backs it. The source panel is a
   fixed-height window onto a complete file: the whole file is present in the
   document, the panel only governs how much of it is shown at once. */

.apx-entry { padding-block: 2.5rem; border-top: 1px solid rgba(0, 0, 0, .1); }
.apx-entry:first-of-type { border-top: 0; }

.apx-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem; opacity: .5; margin: 0 0 .35rem; }
.apx-entry h2 { margin: 0 0 .3rem; font-size: 1.25rem; }

/* The two axes are independent: a file can be publishable while its repository
   is not. Stating both is what keeps "complete" from overclaiming. */
.apx-axes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; letter-spacing: .03em; margin: 0 0 1rem; }
.apx-axes span { display: inline-block; padding: .15rem .5rem; border-radius: 3px;
  background: rgba(0, 0, 0, .05); margin-right: .4rem; }

.apx-controls { display: flex; justify-content: flex-end; gap: .4rem; margin: 0 0 .35rem; }
.apx-copy, .apx-open {
  border: 1px solid rgba(0, 0, 0, .14); background: transparent; color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem;
  padding: .12rem .45rem; border-radius: 4px; cursor: pointer; opacity: .6; line-height: 1.5; }
.apx-copy:hover, .apx-open:hover { opacity: 1; background: rgba(0, 0, 0, .04); }
.apx-copy[data-done="1"] { opacity: 1; border-color: rgba(0, 0, 0, .3); }

/* Self-sufficient rather than scoped to .post-body: this page uses reading.njk,
   which does not emit that wrapper. The class is specific enough alone. */
pre.apx-source { max-height: min(23svh, 213px); overflow: auto; margin: 0;
  background: #eef0f7; border-radius: 8px; padding: .9rem 1rem;
  max-width: 100%; width: 100%; }
/* Alignment is the content in source: pre-wrap would reflow an indented block
   to column 0 and misrepresent the structure. Scroll instead. */
pre.apx-source code { white-space: pre; overflow-wrap: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }


.apx-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem;
  opacity: .65; margin: .6rem 0 0; }

dialog.apx-modal { width: min(825px, 70vw); height: min(66svh, 675px); padding: 0;
  border: 0; background: transparent; color: inherit; overflow: visible; }
/* The surface lives on the wrapper, not the dialog, because the wrapper is what
   animates -- see appendix.js. Reuses the card dialogs' rise and the shared
   backdrop fade from site.css; the global prefers-reduced-motion rule there
   disables both. */
.apx-modal-inner { height: 100%; border-radius: 10px; background: #eef0f7;
  overflow: hidden; display: flex; flex-direction: column; }
dialog.apx-modal[open] .apx-modal-inner {
  transform-origin: 50% 60%;
  animation: note-pop-in .28s cubic-bezier(.2, .8, .2, 1) both; }
dialog.apx-modal.is-closing .apx-modal-inner {
  animation: note-pop-out .16s ease-in both; }
dialog.apx-modal[open]::backdrop { animation: note-backdrop-in .24s ease-out both; }
dialog.apx-modal.is-closing::backdrop { animation: note-backdrop-out .16s ease-in both; }
dialog.apx-modal::backdrop { background: rgba(0, 0, 0, .45); }
.apx-modalhead { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid rgba(0, 0, 0, .12);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
.apx-modal pre { margin: 0; flex: 1 1 auto; min-height: 0; overflow: auto;
  border-radius: 0; background: transparent; max-width: none; width: auto;
  padding: .9rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.apx-modal pre code { white-space: pre; overflow-wrap: normal; }

/* Line numbers, modal only: they are navigation for a complete file and noise
   on a short excerpt. Drawn with a counter rather than inserted as text, so
   they never join a selection -- copying the modal still yields the file
   exactly as it is on disk. */
.apx-modal pre.apx-numbered code { counter-reset: apxline; }
.apx-line { display: block; counter-increment: apxline; }
.apx-line::before {
  content: counter(apxline);
  display: inline-block;
  /* Smaller than the code it numbers: the gutter is a coordinate, not content.
     Sized in em so it tracks the code's own size, and the width stays in ch of
     the reduced size -- four digits still fit at 4,060 lines. */
  font-size: .82em;
  width: 4ch;
  margin-right: 1.4ch;
  text-align: right;
  opacity: .35;
  user-select: none;
  -webkit-user-select: none;
}

/* A diagram, not source: it is short, alignment-critical, and shown in full.
   No panel, no controls -- the shape is the whole content. */
.apx-caption { font-size: .84rem; opacity: .7; margin: 1.4rem 0 .4rem; }
pre.apx-diagram { margin: 0 0 .4rem; background: #eef0f7; border-radius: 8px;
  padding: .9rem 1rem; overflow-x: auto; max-width: 100%; }
pre.apx-diagram code { white-space: pre; overflow-wrap: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem;
  line-height: 1.55; }

/* A dry note after the record, in the page's voice rather than the document's. */
.apx-closer { font-size: .92rem; opacity: .72; font-style: italic;
  margin: 1.1rem 0 0; }

/* Section references. These pop the text in place rather than navigating: the
   reader is mid-entry and the reference is context, not a destination. The
   popover carries a link out for anyone who does want the full section. */
.apx-refs { font-size: .82rem; opacity: .8; margin: 1.1rem 0 0;
  display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.apx-ref { border: 1px solid rgba(0, 0, 0, .16); background: transparent;
  color: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem; padding: .1rem .45rem; border-radius: 4px; cursor: pointer;
  margin-right: .3rem; }
.apx-ref:hover, .apx-ref[aria-expanded="true"] { background: rgba(0, 0, 0, .05); }

.apx-pop { position: absolute; z-index: 40; max-width: min(34rem, 88vw);
  background: #eef0f7; border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px;
  padding: .75rem .9rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  font-size: .85rem; line-height: 1.5; }
.apx-pop h3 { margin: 0 0 .35rem; font-size: .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .7; }
.apx-pop p { margin: 0; }
.apx-pop a { display: inline-block; margin-top: .5rem; font-size: .78rem; }
@media (prefers-reduced-motion: no-preference) {
  .apx-pop { animation: note-pop-in .18s cubic-bezier(.2, .8, .2, 1) both; }
}

/* The through-line, before the entries. Set apart from the lead: the lead says
   what the page is, this says what the entries amount to together. */
.apx-arc { font-size: .95rem; opacity: .82; margin: 0 0 2.5rem;
  padding-left: 1rem; border-left: 2px solid rgba(0, 0, 0, .12); }
