.mode-switch {
  position: fixed;
  right: auto;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(248px, calc(100vw - 36px));
  min-height: 48px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(12, 14, 20, 0.28);
  border-radius: 999px;
  background: rgba(244, 247, 253, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 38px rgba(43, 50, 68, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.mode-switch__option {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: rgba(12, 14, 20, 0.62);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  transition:
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.mode-switch__option::before {
  content: "[";
  margin-right: 3px;
}

.mode-switch__option::after {
  content: "]";
  margin-left: 3px;
}

.mode-switch__option:not([aria-current="page"]):hover {
  color: #0b0c10;
  background: rgba(255, 255, 255, 0.46);
  transform: translateY(-1px);
}

.mode-switch__option[aria-current="page"] {
  color: #f4f7fd;
  background: #0b0c10;
  box-shadow: 0 6px 18px rgba(20, 23, 31, 0.2);
  cursor: default;
}

.mode-switch__option:focus-visible {
  outline: 1px solid #0b0c10;
  outline-offset: -4px;
}

.mode-switch__option[aria-current="page"]:focus-visible {
  outline-color: #f4f7fd;
}

.has-mode-switch .bottom-rail {
  bottom: 84px !important;
}

.has-mode-switch .cookie-notice {
  bottom: 84px !important;
}

.has-mode-switch > footer {
  padding-bottom: 92px !important;
}

@media (max-width: 920px) {
  .mode-switch {
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(230px, calc(100vw - 32px));
    min-height: 46px;
  }

  .mode-switch__option {
    min-height: 38px;
    font-size: 9px;
  }

  .has-mode-switch .bottom-rail {
    bottom: 76px !important;
  }

  .has-mode-switch .cookie-notice {
    bottom: 76px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-switch__option {
    transition: none;
  }
}
