/* Marginalia note content. Shared with layout-free source presentations. */
/* Layout-free sources become compact notes, including their related reading.
   The normal standalone page keeps its full reading layout. */
body:not(:has(.cm-workspace)) > [data-pmx-view] > .pmx-document {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--cm-space-5));
  max-width: 24rem;
  margin: var(--cm-space-2) auto var(--cm-space-5);
  padding: var(--cm-space-5);
  border: 1px solid color-mix(in srgb, var(--pmx-color-border) 65%, transparent);
  background: var(--pmx-color-bg);
  font-size: var(--cm-text-small);
}
body:not(:has(.cm-workspace)) .cm-concept { margin: 0; }
body:not(:has(.cm-workspace)) .cm-concept-figure {
  margin: 0 0 var(--cm-space-5);
}
body:not(:has(.cm-workspace)) .cm-concept-figure img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
}
body:not(:has(.cm-workspace)) .pmx-document :is(h1, .cm-concept-definition h1) {
  font-size: var(--cm-text-term);
  line-height: var(--cm-leading-heading);
  margin: 0 0 var(--cm-space-3);
}
body:not(:has(.cm-workspace)) .pmx-document p {
  font-size: var(--cm-text-small);
  line-height: var(--cm-leading-body);
  margin-block: 0 var(--cm-space-3);
}
body:not(:has(.cm-workspace)) .cm-related {
  margin-top: var(--cm-space-5);
  padding-top: var(--cm-space-3);
}
body:not(:has(.cm-workspace)) .cm-related :is(p, ul, li) {
  font: var(--cm-text-label)/var(--cm-leading-label) var(--cm-font-label);
  margin: 0;
}
body:not(:has(.cm-workspace)) .cm-related ul { gap: var(--cm-space-2); }
body:not(:has(.cm-workspace)) .cm-related .cm-related-title { margin-bottom: var(--cm-space-2); }
body:not(:has(.cm-workspace)) .cm-related a::before { content: "↗ "; color: var(--pmx-color-muted); }
/* This illustration includes whitespace around the drawn frame. Crop only its
   note-card presentation; the source artwork and full-size viewer stay intact. */
body:not(:has(.cm-workspace)) .cm-concept-figure:has(img[src*="img-6d53a4074a17"]) {
  overflow: hidden;
  aspect-ratio: 1.46;
}
body:not(:has(.cm-workspace)) .cm-concept-figure img[src*="img-6d53a4074a17"] {
  width: 118%;
  max-width: none;
  transform: translate(-9.5%, -9%);
}

/* Embedded Marginalia has its own close control over the card's top corner. */
html[data-marginalia-document] .pmx-document { margin-top: 0 !important; padding-top: var(--cm-space-7) !important; }
html[data-marginalia-active] .pmx-document { border-color: var(--pmx-color-border-strong) !important; }
@media (max-width:48rem) {
  html[data-marginalia-document], html[data-marginalia-document] body { background: transparent; }
  html[data-marginalia-document] .pmx-document { width:100% !important; margin:0 !important; }
}
/* Marginalia owns the stable outer shell; source content owns only its inset. */
html[data-marginalia-document] .pmx-document {
  width:100% !important;
  max-width:none;
  border:0 !important;
  margin:0 !important;
}

/* Compact references: retain the aside's accessible name, omit its visual label. */
html[data-marginalia-document] .cm-related .cm-related-title { display:none; }
html[data-marginalia-document] .cm-related { margin-top:var(--cm-space-3); padding-top:var(--cm-space-2); }
html[data-marginalia-document] .cm-related ul { gap:var(--cm-space-1); }
html[data-marginalia-document] .cm-related a { display:inline-flex; align-items:baseline; gap:var(--cm-space-2); padding-block:var(--cm-space-1); }
html[data-marginalia-document] .cm-related a::before { content:none; }
.marginalia-reference-glyph { width:1em; height:1em; flex:none; align-self:center; fill:none; stroke:currentColor; stroke-width:1.3; color:var(--pmx-color-muted); }
