ema-modal {
  input[type="checkbox"] {
    display:none;
  }
  input[type="checkbox"]:checked ~ .modal,
  input[type="checkbox"]:checked ~ .modal-background {
    display: block;
    opacity: 1;
  }

  .modal-wrapper {
    z-index: 9996;
    display: block;
  }

  .modal-background {
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    z-index: 9998;
    transition: opacity 200ms;
  }
  .modal {
    border-radius: var(--ema-border-radius, 3px);
    background: var(--ema-background, white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    min-height: 180px;
    min-width: 180px;
    opacity: 0;
    display: none;
    box-sizing: border-box;
    z-index: 9999;
    transition: opacity 200ms;
    overflow-y: auto;
  }
  .modal-align-top {
    margin: var(--ema-paddig, 15px) auto;
  }
  .modal-header {
    background-color: var(--ema-background, white);
    border-bottom: var(--ema-border, 1px solid #c5c9cd);
    box-sizing: border-box;
    padding: var(--ema-padding-md, 1rem);
    //height: 50px;
    .modal-title {
      margin: 0;
      box-sizing: border-box;
      font-weight: bold;
    }
    label {
      position: absolute;
      box-sizing: border-box;
      top: var(--ema-padding-md, 1rem);
      right: var(--ema-padding-md, 1rem);
      line-height: 50px;
      padding: 0 var(--ema-padding-md, 1rem) 0 var(--ema-padding-md, 1rem);
      margin-top: -1rem;
      margin-right: -1rem * 0.8;
      cursor: pointer;
      z-index: 1;
    }
    label:hover img {
      opacity: 0.6;
    }
    &.modal-header-centered {
      text-align: center;
      .modal-title {
        text-align: center;
        padding-top: var(--ema-padding-xl, 2rem);
        margin: 0 auto;
      }
      label {
        right: 50%;
        margin-left: -8px;
      }
    }
    &.modal-header-no-title {
      border-bottom: none;
      label {
        top: var(--ema-padding-sm, 0.5rem);
      }
    }
  }
  .modal-content-render {
    padding: var(--ema-padding-md, 1rem);
    &.modal-content-centered {
      text-align: center;
      position: absolute;
      left: 50%;
      top: 50%;
      -webkit-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);
    }
  }

}
