.document-note-preview {
  position: fixed; z-index: 1000; box-sizing: border-box;
  width: calc(850px * 2 / 3); max-width: calc(100vw - 16px);
  max-height: min(420px, 65dvh); overflow: auto; padding: 18px;
  border: 1px solid var(--glass-line); border-radius: var(--radius-medium);
  background: var(--color-surface-elevated); color: var(--text);
  box-shadow: var(--shadow-elevated); font-size: .9rem; line-height: 1.6;
  overflow-wrap: anywhere;
}
.document-note-preview[hidden] { display: none; }
.document-note-preview p { margin: 8px 0 14px; }
.document-note-preview a { color: var(--text); }
.document-note-preview img { max-width: 100%; height: auto; }
@media print { .document-note-preview { display: none; } }

.post .footnotes {
  margin-top: 58px;
  padding: 24px;
  border: 1px solid rgba(139, 216, 255, 0.2);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(139, 216, 255, 0.07), rgba(215, 184, 255, 0.05));
  scroll-margin-top: 110px;
}

.post .footnotes > hr {
  display: none;
}

.post-endnotes-header {
  margin-bottom: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post .post-endnotes-eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--font-symbol), var(--font-body), system-ui, sans-serif;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.post .post-endnotes-heading {
  margin: 0;
  color: #f4f8ff;
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  letter-spacing: -0.035em;
}

.post .post-endnotes-help {
  margin: 8px 0 0;
  color: rgba(199, 211, 230, 0.72);
  font-size: 0.76rem;
  line-height: 1.65;
}

.post .footnotes > ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.post .footnotes > ol > li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px 10px 4px;
  border-radius: 12px;
  color: rgba(231, 238, 249, 0.84);
  font-size: 0.88rem;
  line-height: 1.75;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.post .footnotes > ol > li::marker {
  color: var(--accent);
  font-family: var(--font-symbol), var(--font-body), system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.post .footnotes > ol > li p {
  grid-column: 2;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.post .post-endnote-number-link {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(139, 216, 255, 0.34);
  border-radius: 999px;
  background: rgba(139, 216, 255, 0.11);
  color: var(--accent);
  font-family: var(--font-symbol), var(--font-body), system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.post .post-endnote-number-link:hover,
.post .post-endnote-number-link:focus-visible {
  border-color: rgba(139, 216, 255, 0.72);
  background: rgba(139, 216, 255, 0.2);
  color: #fff;
  text-shadow: none;
}

.post .post-endnote-reference {
  display: inline-grid;
  place-items: center;
  min-width: 1.38em;
  height: 1.38em;
  margin: 0 0.12em;
  padding: 0 0.25em;
  border: 1px solid rgba(139, 216, 255, 0.3);
  border-radius: 999px;
  background: rgba(139, 216, 255, 0.1);
  color: #c8f1ff;
  font-family: var(--font-symbol), var(--font-body), system-ui, sans-serif;
  font-size: 0.68em;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.26em;
}

.post .post-endnote-reference:hover,
.post .post-endnote-reference:focus-visible {
  border-color: rgba(139, 216, 255, 0.74);
  background: rgba(139, 216, 255, 0.2);
  color: #fff;
  text-shadow: none;
}

.post .post-endnote-backlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  margin-left: 5px;
  border: 1px solid rgba(215, 184, 255, 0.25);
  border-radius: 999px;
  background: rgba(215, 184, 255, 0.08);
  color: #e8d8ff;
  font-family: var(--font-symbol), var(--font-body), system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.post .post-endnote-backlink:hover,
.post .post-endnote-backlink:focus-visible {
  border-color: rgba(215, 184, 255, 0.65);
  background: rgba(215, 184, 255, 0.17);
  color: #fff;
  text-shadow: none;
}

.post .footnotes > ol > li.is-footnote-target,
.post sup.is-footnote-target {
  background: rgba(139, 216, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(139, 216, 255, 0.11);
}


.post .post-endnotes-heading { color: var(--text); }
.post .post-endnotes-help, .post .footnotes > ol > li { color: var(--soft); }
.post .footnotes > ol > li > :not(.post-endnote-number-link) { grid-column: 2; min-width: 0; }
.post .footnotes > ol > li ul, .post .footnotes > ol > li ol { display: block; padding-left: 1.5em; }
@media (max-width: 600px) {
  .post .footnotes { padding: 16px 10px; margin-top: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .post .footnotes > ol > li { transition: none; }
}
@media print {
  .post .footnotes { break-inside: auto; border-color: #ccc; background: none; }
}
