/* Place the switch after the search form, never inside it or the search overlay. */
.fyk-switch-slot { width: fit-content; max-width: 100%; margin: 12px auto; }
html.fyk-feed-booting body.home.page-template-forums #forum .bbs-home-tab > .fixed-wrap-nav { visibility: hidden !important; }
.widget-search > .search-input.fyk-search-with-switch {
  display: flex; align-items: center; gap: 16px; max-width: 760px;
}
.widget-search > .search-input.fyk-search-with-switch > form.search-form { flex: 1 1 0; min-width: 0; }
.widget-search > .search-input.fyk-search-with-switch > .fyk-switch-slot { flex: 0 0 auto; margin: 0; }
@media (max-width: 600px) {
  .widget-search > .search-input.fyk-search-with-switch { gap: 6px; }
  .fyk-switch-slot > a.fyk-page-switch { font-size: 12px; }
}
/* All visual rules are scoped to the new search-row control. */
.fyk-switch-slot > a.fyk-page-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--muted-border-color, #d9e2ed);
  border-radius: 999px;
  background: var(--main-bg-color, #fff);
  color: var(--focus-color, #176bc6);
  font: inherit;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  transition: border-color 140ms ease, color 140ms ease;
}
.fyk-switch-slot > a.fyk-page-switch:hover {
  border-color: currentColor;
}
.fyk-switch-slot > a.fyk-page-switch:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.fyk-page-switch .fyk-switch-icon { flex: 0 0 16px; }
.dark-theme .fyk-switch-slot > a.fyk-page-switch {
  background: var(--main-bg-color, #232731);
  border-color: var(--muted-border-color, #414854);
  color: var(--focus-color, #82baff);
}
/* Keep the old snapshot opaque underneath the new page throughout the reveal. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) {
  animation: none;
  opacity: 1;
  mix-blend-mode: normal;
}
html.fyk-switch-arriving::view-transition-old(root) { z-index: 1; }
html.fyk-switch-arriving::view-transition-new(root) { z-index: 2; }
html.fyk-switch-arriving::view-transition-new(root) {
  animation: fyk-page-reveal 420ms cubic-bezier(.22, 1, .36, 1) both;
}
html.fyk-switch-arriving[data-fyk-switch-direction="back"]::view-transition-new(root) {
  animation-name: fyk-page-reveal-back;
}
@keyframes fyk-page-reveal {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes fyk-page-reveal-back {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
/* Fallback movement stays fully visible; never animate body opacity. */
html.fyk-switch-arriving:not(.fyk-switch-native) main {
  animation: fyk-page-settle 420ms cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes fyk-page-settle {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}
/* Hold the opaque source snapshot until the target search/layout is initialized.
   Opacity only: transforming main changes fixed/affixed descendants' positioning. */
@media (min-width: 768px) {
  html.fyk-switch-arriving::view-transition-new(root) {
    animation: fyk-desktop-enter 560ms cubic-bezier(.4, 0, .2, 1) both paused;
  }
  html.fyk-switch-arriving[data-fyk-switch-direction="back"]::view-transition-new(root) {
    animation-name: fyk-desktop-enter;
  }
  html.fyk-switch-arriving.fyk-switch-reveal-ready::view-transition-new(root) {
    animation-play-state: running;
  }
  html.fyk-switch-arriving:not(.fyk-switch-native) main {
    animation: none;
    opacity: .15;
  }
  html.fyk-switch-arriving.fyk-switch-reveal-ready:not(.fyk-switch-native) main {
    animation: fyk-desktop-settle 560ms cubic-bezier(.4, 0, .2, 1) both;
  }
}
@keyframes fyk-desktop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fyk-desktop-settle {
  from { opacity: .15; }
  to { opacity: 1; }
}
.fyk-switch-slot > a.fyk-page-switch { position: relative; isolation: isolate; overflow: hidden; }
.fyk-switch-slot > a.fyk-page-switch::after {
  content: "";
  position: absolute;
  inset: -50% auto -50% -40%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-160%) rotate(18deg);
  pointer-events: none;
  opacity: 0;
}
.fyk-switch-slot > a.fyk-page-switch > span,
.fyk-switch-slot > a.fyk-page-switch > svg { position: relative; z-index: 1; }
html.fyk-switch-pending .fyk-switch-slot > a.fyk-page-switch::after {
  opacity: 1;
  animation: fyk-loading-sheen 900ms ease-in-out infinite;
}
html.fyk-switch-pending .fyk-switch-icon {
  animation: fyk-loading-icon 900ms ease-in-out infinite alternate;
}
html.fyk-switch-pending body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 2147483647;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #a997ee 35%, #7860cb 55%, transparent 100%);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  animation: fyk-loading-progress 1100ms ease-in-out infinite;
}
@keyframes fyk-loading-sheen {
  to { transform: translateX(650%) rotate(18deg); }
}
@keyframes fyk-loading-icon { to { transform: translateX(3px); } }
@keyframes fyk-loading-progress {
  from { background-position: -85% 0; }
  to { background-position: 185% 0; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .fyk-switch-slot > a.fyk-page-switch { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html.fyk-switch-arriving::view-transition-new(root),
  html.fyk-switch-arriving:not(.fyk-switch-native) main,
  html.fyk-switch-pending .fyk-switch-icon { animation: none; }
  html.fyk-switch-arriving:not(.fyk-switch-native) main { opacity: 1; }
  html.fyk-switch-pending body::before,
  .fyk-switch-slot > a.fyk-page-switch::after { display: none; }
}
@media (forced-colors: active) {
  .fyk-switch-slot > a.fyk-page-switch { border-color: ButtonText; color: LinkText; }
}
