.yn-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.yn-field.form-check {
  padding-left: 0;
}

.yn-selector {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  flex: 0 0 70px;
  width: 70px;
  height: 28px;
  margin: .125rem .25rem;
  overflow: hidden;
  border: 1px solid #c9d8e1;
  border-radius: 999px;
  background: #f8fbfc;
}

.yn-selector::before {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 58%;
  height: calc(100% - 2px);
  border-radius: 999px;
  background: #087caf;
  content: "";
  transition: left .18s ease;
}

.yn-selector[data-selected="n"]::before {
  left: calc(42% - 1px);
}

.yn-choice {
  position: relative;
  z-index: 1;
  flex: 1 1 50%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #587082;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
}

.yn-selector[data-selected="y"] .yn-yes,
.yn-selector[data-selected="n"] .yn-no {
  color: #fff;
}

.yn-choice:focus-visible {
  outline: 2px solid #ffb320;
  outline-offset: -4px;
  border-radius: 999px;
}

.yn-choice:disabled {
  cursor: not-allowed;
}

.yn-selector:has(.yn-choice:disabled) {
  opacity: .6;
}

td > .yn-selector {
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .yn-selector::before { transition: none; }
}
