.site-version-switch {
  font: inherit;
  cursor: pointer;
}

/* The original navigation bar, shared by both independent page designs. */
#progress-bar {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  z-index: 2147483001;
  pointer-events: none;
  background: var(--primary, #4c94ff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--primary, #4c94ff) 65%, transparent);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  view-transition-name: olx-progress;
}
@keyframes olx-progress-loading { from { transform: scaleX(.08); } to { transform: scaleX(.94); } }
#progress-bar.loading { opacity: 1; animation: olx-progress-loading 8s cubic-bezier(.1,.05,.1,1) forwards; }
#progress-bar.finishing { opacity: 1; animation: none; transform: scaleX(1); transition: transform .2s ease-out; }
#progress-bar.done { opacity: 0; animation: none; transform: scaleX(1); transition: opacity .3s ease-out; }
::view-transition-group(olx-progress) { z-index: 1; animation: none; }
::view-transition-old(olx-progress) { display: none; }
::view-transition-new(olx-progress) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #progress-bar.loading { animation: none; transform: scaleX(.75); }
  #progress-bar.finishing, #progress-bar.done { transition: none; }
}

/* Keep the outgoing document visible while the independent page set loads. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 480ms; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 480ms; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
.site-version-switch[aria-busy="true"] { cursor: progress; }

/* A single GSAP-controlled reveal of the two real document snapshots. */
@keyframes site-switch-hold { from { opacity: 1; } to { opacity: 1; } }
html[data-site-switch-motion]::view-transition-group(root) { animation: none; }
html[data-site-switch-motion]::view-transition-image-pair(root) {
  background: linear-gradient(160deg, #f8fcff, #d4edff 48%, #fff0f8);
  overflow: hidden;
}
html[data-site-switch-motion]::view-transition-old(root),
html[data-site-switch-motion]::view-transition-new(root) {
  animation: site-switch-hold 1s linear infinite;
  mix-blend-mode: normal;
}
html[data-site-switch-motion]::view-transition-old(root) {
  clip-path: polygon(0 0, calc(var(--switch-edge-top, 112%) - var(--switch-edge-width, 0px)) 0,
    calc(var(--switch-edge-bottom, 100%) - var(--switch-edge-width, 0px)) 100%, 0 100%);
  filter: brightness(var(--switch-old-light, 1));
}
html[data-site-switch-motion]::view-transition-new(root) {
  clip-path: polygon(var(--switch-edge-top, 112%) 0, 100% 0, 100% 100%, var(--switch-edge-bottom, 100%) 100%);
  transform: scale(var(--switch-new-scale, 1.025));
  filter: brightness(var(--switch-new-light, 1));
}
html[data-site-switch-arrival="original"][data-site-switch-motion]::view-transition-old(root) {
  clip-path: polygon(calc(100% - var(--switch-edge-top, 112%) + var(--switch-edge-width, 0px)) 0,
    100% 0, 100% 100%, calc(100% - var(--switch-edge-bottom, 100%) + var(--switch-edge-width, 0px)) 100%);
}
html[data-site-switch-arrival="original"][data-site-switch-motion]::view-transition-new(root) {
  clip-path: polygon(0 0, calc(100% - var(--switch-edge-top, 112%)) 0, calc(100% - var(--switch-edge-bottom, 100%)) 100%, 0 100%);
}

/* Hide the mascot byline and its now-unused author toggle on every page. */
#live2d-author,
#toolbar-info { display: none !important; }

.site-version-switch--reference {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  min-width: 2.625rem;
  height: 2.625rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary, #3b82f6) 22%, transparent);
  border-radius: .75rem;
  color: var(--deep-text, #334155);
  background: transparent;
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.site-version-switch--reference .site-version-switch__icon {
  display: block;
  line-height: 1;
  transform: translateY(-.04em);
}

.site-version-switch--reference:hover {
  color: var(--primary, #3b82f6);
  border-color: color-mix(in srgb, var(--primary, #3b82f6) 20%, transparent);
  background: color-mix(in srgb, var(--primary, #3b82f6) 9%, transparent);
}

.site-version-switch--reference:active { transform: scale(.96); }
.site-version-switch--reference:focus-visible { outline: 3px solid rgb(59 130 246 / .35); outline-offset: 2px; }

.site-version-switch--original.dock-btn .dock-btn-icon {
  font-size: 1.45rem;
  font-weight: 500;
}

.site-version-switch--original.dock-btn {
  border: 2px solid #000;
}

html.dark .site-version-switch--original.dock-btn {
  border-color: #fff;
}

.site-version-switch--fallback {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: .55rem .8rem;
  border: 1px solid color-mix(in srgb, var(--primary, #3b82f6) 35%, transparent);
  border-radius: 999px;
  color: var(--deep-text, #334155);
  background: color-mix(in srgb, var(--card-bg, #fff) 92%, transparent);
  box-shadow: 0 10px 28px rgb(15 23 42 / .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-version-switch--fallback:hover { transform: translateY(-2px); }
.site-version-switch--fallback:focus-visible { outline: 3px solid rgb(59 130 246 / .35); outline-offset: 3px; }

html.dark .site-version-switch--reference,
html.dark .site-version-switch--fallback { color: #e5edf8; }

@media (max-width: 760px) {
  .site-version-switch--reference { width: 2.25rem; min-width: 2.25rem; height: 2.25rem; }
  .site-version-switch--fallback { right: .7rem; bottom: max(.7rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .site-version-switch { transition: none !important; }
}
