:root {
  --checkbox-size: 18px;
  --checkbox-border: #8fa6b2;
  --checkbox-accent: #176ca4;
  --checkbox-focus: rgba(43, 191, 237, .28);
}

/* Keep true tick boxes separate from the deliberately switch-shaped controls. */
input[type="checkbox"]:not([role="switch"]) {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-block !important;
  flex: 0 0 var(--checkbox-size) !important;
  width: var(--checkbox-size) !important;
  min-width: var(--checkbox-size) !important;
  max-width: var(--checkbox-size) !important;
  height: var(--checkbox-size) !important;
  min-height: var(--checkbox-size) !important;
  max-height: var(--checkbox-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1.5px solid var(--checkbox-border) !important;
  border-radius: 4px !important;
  outline: 0;
  background-color: #fff !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 13px 13px !important;
  box-shadow: 0 1px 2px rgba(15, 52, 78, .08);
  vertical-align: middle;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}

input[type="checkbox"]:not([role="switch"]):hover:not(:disabled) {
  border-color: var(--checkbox-accent) !important;
}

input[type="checkbox"]:not([role="switch"]):checked {
  border-color: var(--checkbox-accent) !important;
  background-color: var(--checkbox-accent) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.25 8.25 6.65 11.5 12.8 4.65' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

input[type="checkbox"]:not([role="switch"]):indeterminate {
  border-color: var(--checkbox-accent) !important;
  background-color: var(--checkbox-accent) !important;
  background-image: linear-gradient(#fff, #fff) !important;
  background-position: center !important;
  background-size: 9px 2px !important;
}

input[type="checkbox"]:not([role="switch"]):focus-visible {
  outline: 3px solid var(--checkbox-focus) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 1px var(--checkbox-accent) !important;
}

input[type="checkbox"]:not([role="switch"]):disabled {
  border-color: #bdcbd2 !important;
  background-color: #edf2f4 !important;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}

input[type="checkbox"]:not([role="switch"]):checked:disabled {
  border-color: #7898aa !important;
  background-color: #7898aa !important;
}

label:has(> input[type="checkbox"]:not([role="switch"])) {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
  cursor: pointer;
}

label:has(> input[type="checkbox"]:not([role="switch"]):disabled) {
  cursor: not-allowed;
}

label.check:has(> input[type="checkbox"]:not([role="switch"])):has(> small) {
  display: grid;
  grid-template-columns: var(--checkbox-size) minmax(0, 1fr);
  gap: 3px 9px;
  align-items: start;
}

label.check:has(> input[type="checkbox"]:not([role="switch"])):has(> small) > input {
  grid-row: 1 / 3;
}

label.check:has(> input[type="checkbox"]:not([role="switch"])):has(> small) > small {
  grid-column: 2;
}

.workflow-check-sample span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.workflow-sample-checkbox {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1.5px solid var(--checkbox-border);
  border-radius: 3px;
  background: #fff;
}

@media (forced-colors: active) {
  input[type="checkbox"]:not([role="switch"]) {
    appearance: auto !important;
  }
}
