@if index($partials, modal) {
  #overlay {
    bottom: 0;
    left: 0;
    opacity: 0;
    overflow-y: auto;
    position: fixed;
    right: 0;
    text-align: center;
    top: 0;
    transition-property: (opacity);
    transition-duration: ($ease);
    visibility: hidden;
    z-index: 1000;
  }

  #modal {
    background: #FFF;
    border-radius: $radius;
    display: none;
    margin: 4*$space auto;
    max-width: 600px;
    text-align: left;
    width: 50%;
    z-index: 3000;
    @include animation(slide 0.2s ease);
    transition-property: (width);
    transition-duration: ($ease);
    @include keyframes(slide) {
      0% {
        margin-top: 0;
      }
      100% {
        margin-top: $space*4;
      }
    }
    > .header {
      border-bottom: 1px solid $line;
      border-radius: $radius $radius 0 0;
      padding: 1.5*$space/2 $space;
      h2 {
        font-size: inherit;
        line-height: inherit;
        margin: 0;
      }
      .close {
        float: right;
      }
    }
    .body {
      padding: 1.5*$space/2 $space;
      > *:last-child {
        margin-bottom: 0;
      }
    }
  }

  body.modal #overlay,
  #overlay.active {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    visibility: visible;
  }
  body.modal #modal,
  #modal.active {
    display: block;
    width: 90%;
  }
}
