/* Shared by every assembled page, including retained and generated pages. */
:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --viewport-bg: var(--bg, var(--paper, #F7F6F4));
}
html { background-color: var(--viewport-bg); }
/* Safari can paint scrolled content above the layout viewport. Extend the
   opaque surface upwards as well as across the status-bar safe area. This
   layer never receives input and leaves the document's scrolling untouched. */
html::before {
  content: "";
  position: fixed;
  z-index: 100;
  inset: -100vh 0 calc(100% - var(--safe-area-top));
  background: var(--viewport-bg);
  pointer-events: none;
}
.bar { padding-top: var(--safe-area-top); }
/* Pages without navigation still reserve the area covered by the surface. */
body:not(:has(.bar)) { border-top: var(--safe-area-top) solid var(--viewport-bg); }

/* The same mobile footer layout covers the current design and retained pages.
   Keep this here, after each page's own CSS, so an older page cannot restore
   one-link-per-line navigation or shrink the theme control's touch target. */
@media (max-width: 760px) {
  .foot .col { flex-direction: column; align-items: flex-start; gap: 16px; }
  .foot nav, .site-footer nav { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0 20px; width: 100%; }
  .foot nav a { display: inline-flex; align-items: center; min-height: 40px; }
  .foot .right { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .foot .maker, .foot .right > span:not(.rule) { margin-right: auto; min-width: 0; line-height: 20px; }
  .foot .rule { flex: none; margin-inline: 8px; }
  .foot :is(.view, .theme) { flex: none; width: 40px; height: 40px; }
  .foot .theme .icon { inset: 12px; }
  .foot :is(.view, .theme)::before { inset: 0; }
}
@media print {
  html::before { display: none; }
}
