/*
  based on https://proto.io/freebies/onoff/
  auto resize
  custom texts

  TODO: wrap with  $(document).on('DOMNodeInserted', 'input', function () { });
*/
.onoffswitch {
    position: relative;
    -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
    display:inline-block;
    width:auto;
    box-sizing: initial;
    vertical-align: middle;
}
.onoffswitch-checkbox {
    position: absolute;
    left: 0;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
.onoffswitch label {
    display: block; overflow: hidden; cursor: pointer;
    border: 1px solid #999999; border-radius: 20px;
    margin-bottom:0;
    text-align: left;
}
.onoffswitch-inner {
    display: block; width: 200%; margin-left: -100%;
    transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
    display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
    font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
    box-sizing: border-box;
}
.onoffswitch-inner:before {
    content: attr(data-content-on);
    padding-left: 10px;
    background-color: #0275d8; color: #FFFFFF;
}
.onoffswitch-inner:after {
    content: attr(data-content-off);
    padding-right: 10px;
    *background-color: #EEEEEE; color: #999999;
    padding-left:30px;
    margin-right:-22px;
    text-align:center;
}
.onoffswitch-switch {
    display: block; width: 18px; height:18px;margin: 6px;
    background: #FFFFFF;
    position: absolute; top: 0; bottom: 0;
    left: 0;
    border: 1px solid #999999; border-radius: 20px;
    transition: all 0.3s ease-in 0s; 
}
.onoffswitch label .onoffswitch-checkbox:checked ~ .onoffswitch-inner {
    margin-left: 0;
}
.onoffswitch label .onoffswitch-checkbox:checked ~ .onoffswitch-switch {
    left: 100%;
    margin-left:-28px;
}