/* Shared preview navigation; kept separate from each design's page styles. */
.design-switcher {
  --switcher-bg: #ffffffed;
  --switcher-text: #231f20;
  --switcher-line: #dddbe1;
  --switcher-tile: #f1eff4;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  --tile-size: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--switcher-line);
  border-radius: 16px;
  background: var(--switcher-bg);
  color: var(--switcher-text);
  box-shadow: 0 8px 32px #0002;
  backdrop-filter: blur(16px);
  font: 500 12px/1.2 'Instrument Sans', Arial, sans-serif;
  letter-spacing: normal;
}
[data-theme="dark"] .design-switcher {
  --switcher-bg: #242127ed;
  --switcher-text: #faf8fc;
  --switcher-line: #49434e;
  --switcher-tile: #353039;
}
.design-switcher__home {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: var(--tile-size);
  color: inherit;
  text-decoration: none;
  font-size: 10px;
}
.design-switcher__home svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.design-switcher__list {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #8a838e transparent;
  padding: 3px;
  margin: 0;
  list-style: none;
}
.design-switcher__list li { flex: 0 0 auto; margin: 0; padding: 0; }
.design-switcher__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tile-size);
  height: var(--tile-size);
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--switcher-tile);
  color: var(--switcher-text);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  transition: background-color .18s, border-color .18s;
}
.design-switcher__tile[href]:hover { border-color: #ffc700; }
.design-switcher__tile[aria-current="page"] { background: #ffc700; color: #231f20; border-color: #ffc700; }
.design-switcher__tile[aria-disabled="true"] { opacity: .45; cursor: default; }
.design-switcher a:focus-visible, .design-switcher__list:focus-visible { outline: 2px solid #b48b00; outline-offset: 2px; }

.design-switcher .theme-switch--square {
  position: relative;
  flex: none;
  display: block;
  width: var(--tile-size);
  height: var(--tile-size);
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--switcher-line);
  border-radius: 8px;
  background: #79d9f2;
  box-shadow: inset 0 2px 5px #0005, 0 5px 20px #0002;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 700ms ease;
}
.theme-switch--square:focus-visible { outline: 3px solid #b48b00; outline-offset: 4px; }
.theme-switch--square::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 2px 5px #0005, inset 0 -1px 2px #fff4;
  pointer-events: none;
}
.theme-switch--square .switch-scenery { display: block; width: 100%; height: 100%; }
.theme-switch--square .sky-halos {
  transition: transform 950ms cubic-bezier(.22, 1, .36, 1);
}
.theme-switch--square .clouds-back {
  transition: transform 850ms cubic-bezier(.22, 1, .36, 1), opacity 600ms ease;
}
.theme-switch--square .clouds-front {
  transition: transform 600ms cubic-bezier(.22, 1, .36, 1), opacity 450ms ease;
}
.theme-switch--square .stars {
  opacity: 0;
  transform: translateY(-45px);
  transition: transform 800ms cubic-bezier(.22, 1, .36, 1), opacity 500ms ease;
}
.theme-switch--square .celestial-body {
  position: absolute;
  top: 42.5%;
  left: 10%;
  width: 47.5%;
  height: 47.5%;
  border-radius: 50%;
  background: #ffdd32;
  box-shadow: inset 0 2px 2px #fff9, inset 0 -2px 2px #a0763040, 0 3px 5px #0005;
  transform: translate(0, 0) rotate(-35deg);
  transition: transform 750ms cubic-bezier(.22, 1, .36, 1), background-color 550ms ease;
}
.theme-switch--square .crater {
  position: absolute;
  border-radius: 50%;
  background: #9b9da5;
  box-shadow: inset 0 1px 2px #0003;
  opacity: 0;
  transition: opacity 450ms ease;
}
.theme-switch--square .crater:nth-child(1) { width: 32%; height: 32%; left: 18%; top: 50%; }
.theme-switch--square .crater:nth-child(2) { width: 21%; height: 21%; right: 13%; top: 55%; }
.theme-switch--square .crater:nth-child(3) { width: 13%; height: 13%; left: 50%; top: 21%; }
[data-theme="dark"] .theme-switch--square { background: #151722; }
[data-theme="dark"] .theme-switch--square .sky-halos { transform: translate(26px, -26px); }
[data-theme="dark"] .theme-switch--square .clouds-back { transform: translate(12px, 65px); opacity: 0; }
[data-theme="dark"] .theme-switch--square .clouds-front { transform: translate(-8px, 75px); opacity: 0; }
[data-theme="dark"] .theme-switch--square .stars { transform: translateY(0); opacity: 1; }
[data-theme="dark"] .theme-switch--square .celestial-body { transform: translate(68.42%, -68.42%) rotate(0); background: #d9dbe1; }
[data-theme="dark"] .theme-switch--square .crater { opacity: 1; }
@media (max-width: 760px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .design-switcher {
    --tile-size: 40px;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100% - 20px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding: 4px;
  }
  .design-switcher__home { width: 28px; }
  .design-switcher__list { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .design-switcher__tile { transition: none; }
  .theme-switch--square, .theme-switch--square * { transition: none !important; }
}
