.sw-modal-backdrop {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: var(--z-index-modal-backdrop);

  &.fade {
    animation: fadeIn 480ms;
  }
  @keyframes fadeIn {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  &.visible {
    background-color: var(--color-backdrop);
  }

  .modal {
    align-items: stretch;
    background-color: transparent;
    border: 0;
    color: inherit;
    display: flex;
    flex-flow: column nowrap;
    left: 50%;
    margin: 0;
    max-width: 100vw;
    padding: 0;
    position: relative;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    z-index: var(--z-index-modal);
  }
  .modal .modal-content {
    background-color: var(--color-light-stronger);
    overflow: auto;
  }

  .modal-content {
    z-index: 0;
    overflow: scroll;
  }
}
@media (min-width: 599px) {
  .sw-modal-backdrop {
    .modal {
      max-height: calc(100vh - var(--popup-top));
      max-width: calc(100vw - var(--rhythm-3));
    }
    .modal .modal-content::-webkit-scrollbar {
      width: var(--rhythm-1);
    }
    .modal .modal-content::-webkit-scrollbar-thumb {
      background-color: var(--color-scrollbar-thumb);
    }
    .modal .modal-content::-webkit-scrollbar-track {
      background-color: var(--color-scrollbar-track);
    }
  }
}
