/* TeleDK v1.0.103 — Global checkbox normalization
   Fixes checkboxes becoming tall/pill-shaped when generic form input min-height
   rules are applied. Intentional Telegram toggle classes remain untouched. */

:root{
  --td-checkbox-size:18px;
  --td-checkbox-radius:5px;
  --td-checkbox-border:#465168;
  --td-checkbox-bg:#0a111a;
  --td-checkbox-accent-1:#8469ef;
  --td-checkbox-accent-2:#6548d8;
  --td-checkbox-focus:rgba(132,105,239,.22);
}

/* Ordinary checkboxes only.
   group-bot-toggle / group-send-toggle are existing dedicated switch controls. */
html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle){
  -webkit-appearance:none!important;
  appearance:none!important;

  display:inline-grid!important;
  place-content:center!important;
  align-self:center;

  box-sizing:border-box!important;
  flex:0 0 var(--td-checkbox-size)!important;

  width:var(--td-checkbox-size)!important;
  min-width:var(--td-checkbox-size)!important;
  max-width:var(--td-checkbox-size)!important;

  height:var(--td-checkbox-size)!important;
  min-height:var(--td-checkbox-size)!important;
  max-height:var(--td-checkbox-size)!important;

  aspect-ratio:1/1!important;
  margin:0!important;
  padding:0!important;

  border:1px solid var(--td-checkbox-border)!important;
  border-radius:var(--td-checkbox-radius)!important;
  background:var(--td-checkbox-bg)!important;

  color:#fff;
  font-size:0!important;
  line-height:1!important;
  vertical-align:middle;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 0 0 0 rgba(132,105,239,0)!important;

  cursor:pointer;
  overflow:hidden!important;
  transform:none;
  transition:
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease,
    transform .10s ease;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):hover{
  border-color:#7865d6!important;
  background:#0d1420!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):checked{
  border-color:#9178f4!important;
  background:linear-gradient(135deg,var(--td-checkbox-accent-1),var(--td-checkbox-accent-2))!important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 0 0 3px rgba(124,92,255,.10)!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):checked::after{
  content:""!important;
  display:block!important;

  width:4px!important;
  height:8px!important;
  margin:-1px 0 1px 0!important;
  padding:0!important;

  border:solid #fff!important;
  border-width:0 2px 2px 0!important;
  border-radius:0!important;

  background:transparent!important;
  box-shadow:none!important;

  transform:rotate(45deg)!important;
  transform-origin:center!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):focus{
  outline:none!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):focus-visible{
  outline:none!important;
  border-color:#a38cf8!important;
  box-shadow:
    0 0 0 3px var(--td-checkbox-focus),
    inset 0 1px 0 rgba(255,255,255,.10)!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):active{
  transform:scale(.92)!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):disabled{
  opacity:.42!important;
  cursor:not-allowed!important;
  transform:none!important;
}

/* Indeterminate state used by "select all" checkboxes. */
html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):indeterminate{
  border-color:#9178f4!important;
  background:linear-gradient(135deg,var(--td-checkbox-accent-1),var(--td-checkbox-accent-2))!important;
}

html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle):indeterminate::after{
  content:""!important;
  display:block!important;
  width:8px!important;
  height:2px!important;
  margin:0!important;
  border:0!important;
  border-radius:999px!important;
  background:#fff!important;
  box-shadow:none!important;
  transform:none!important;
}

/* Existing hidden custom switches stay visually hidden and continue to drive
   their sibling switch UIs. */
.maintenance-switch>input[type="checkbox"],
.coupon-switch-label input[type="checkbox"]{
  position:absolute!important;
  width:1px!important;
  min-width:1px!important;
  max-width:1px!important;
  height:1px!important;
  min-height:1px!important;
  max-height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
  border:0!important;
  box-shadow:none!important;
}

/* Prevent generic form rules from stretching checkbox controls in known forms. */
.portal-form input[type="checkbox"],
.member-create input[type="checkbox"],
.admin-profile-form input[type="checkbox"],
.v80-form input[type="checkbox"],
.v80-form-grid input[type="checkbox"],
.agent-settings-form input[type="checkbox"],
.trial-switch-row input[type="checkbox"],
.v74-checks input[type="checkbox"],
.adopt-row input[type="checkbox"],
.admin-sound-toggle input[type="checkbox"]{
  width:var(--td-checkbox-size)!important;
  min-width:var(--td-checkbox-size)!important;
  max-width:var(--td-checkbox-size)!important;
  height:var(--td-checkbox-size)!important;
  min-height:var(--td-checkbox-size)!important;
  max-height:var(--td-checkbox-size)!important;
  padding:0!important;
}

/* Keep checkbox and nearby label text vertically centered where the checkbox
   is a normal visible control. */
.adopt-row,
.v80-checkline,
.v74-checks label,
.admin-sound-toggle,
.agent-switch{
  align-items:center;
}

@media(max-width:680px){
  :root{--td-checkbox-size:19px}
}

@media(forced-colors:active){
  html input[type="checkbox"]:not(.group-bot-toggle):not(.group-send-toggle){
    forced-color-adjust:auto;
  }
}
