/* Shared page actions inherit each page family's existing accent. */
.site-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: #b40000;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  font: 600 14px/1.4 system-ui, sans-serif;
  cursor: pointer;
  transition: box-shadow .15s ease;
}
.site-back-to-top span { font-size: 20px; line-height: 1; }
.site-back-to-top:hover { box-shadow: 0 5px 20px rgba(0, 0, 0, .32); }
.site-back-to-top:focus-visible { outline: 3px solid currentColor; outline-offset: -6px; }
.site-back-to-top[hidden],
body:has(dialog[open]) .site-back-to-top,
body:has(#lightbox:not(.hidden)) .site-back-to-top { display: none !important; }
.dark[data-current-section="tools"] .site-back-to-top { background: #facc15; color: #18181b; }
[data-current-section="cv"] .site-back-to-top { background: #7a2e12; }
.dark[data-current-section="cv"] .site-back-to-top { background: #dfaa85; color: #171513; }
@media (prefers-reduced-motion: reduce) {
  .site-back-to-top { transition: none; }
}
@media print {
  .site-back-to-top, .site-search-dialog { display: none !important; }
}
