/* The moving background on every page. backdrop.js builds it at the top of <body>, from the clock, so each page
   shows the same lights at the same moment. */
body.has-ambient-backdrop {
  overflow-x: clip;
}
/* Lifts the page above the background lights. :where() keeps this at zero specificity, so anything that places
   itself (the loading bar, the skip link, the phone action bar, overlays) keeps its own position. Dialogs are left
   to the browser, which keeps an open one fixed on screen; forcing them here made them scroll away on iPhones. */
:where(body.has-ambient-backdrop > :not(.ambient-backdrop, script, style, dialog)) {
  position: relative;
  z-index: 1;
}
/* A bar that floats inside the page (Settings' Save settings bar) can only be as high as <main> itself, so <main>
   sits above the footer that follows it; otherwise the footer would take the clicks meant for the bar. */
:where(body.has-ambient-backdrop > main) {
  z-index: 2;
}
body.has-ambient-backdrop > .topbar.topbar {
  z-index: 30;
}
.ambient-backdrop {
  --ambient-core: #3d97c8;
  --ambient-glow: rgba(36, 117, 163, 0.32);
  contain: paint;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}
:root[data-theme="dark"] .ambient-backdrop {
  --ambient-core: #dff5ff;
  --ambient-glow: rgba(120, 199, 243, 0.54);
}
/* Moving to another page: the new page's lights are already where these were, so this layer is shown live the whole
   time instead of fading out and back in with the rest of the page (motion.css). */
.ambient-backdrop {
  view-transition-name: app-backdrop;
}
::view-transition-group(app-backdrop),
::view-transition-new(app-backdrop) {
  animation: none;
}
::view-transition-old(app-backdrop) {
  animation: none;
  opacity: 0;
}
@supports not (overflow: clip) {
  body.has-ambient-backdrop {
    overflow-x: hidden;
  }
}
@media print, (prefers-reduced-motion: reduce) {
  .ambient-backdrop {
    display: none !important;
  }
}
