ai-dialog-overlay {
  bottom: 0;
  left: 0;
  position: fixed;
  top: 0;
  right: 0;
  opacity: 0;

  &.active {
    opacity: 1;
  }
}

ai-dialog-container {
  display: block;
  transition: opacity .2s linear;
  opacity: 0;
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  -webkit-overflow-scrolling: touch;

  &.active {
    opacity: 1;
  }

  & > div {
    padding: 30px;
  }

  & > div > div {
    width: 100%;
    display: block;
    min-width: 300px;
    width: -moz-fit-content;
    width: -webkit-fit-content;
    width: fit-content;
    height: -moz-fit-content;
    height: -webkit-fit-content;
    height: fit-content;
    margin: auto;
  }

  &, & > div, & > div > div {
    // Prevent Chrome on Windows from adding a focus outline. For details, see
    // https://github.com/twbs/bootstrap/pull/10951
    outline: 0;
  }
}

ai-dialog {
  width: 100%;
  display: table;
  box-shadow: 0 5px 15px rgba(0,0,0,.5);
  border: 1px solid rgba(0,0,0,.2);
  border-radius: 5px;
  padding: 3;
  min-width: 300px;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: -webkit-fit-content;
  height: fit-content;
  margin: auto;
  border-image-source: initial;
  border-image-slice: initial;
  border-image-width: initial;
  border-image-outset: initial;
  border-image-repeat: initial;
  background: white;

  > ai-dialog-header {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;

    > button {
      float: right;
      border: none;
      display: block;
      width: 32px;
      height: 32px;
      background: none;
      font-size: 22px;
      line-height: 16px;
      margin: -14px -16px 0 0;
      padding: 0;
      cursor: pointer;
    }
  }

  > ai-dialog-body {
    display: block;
    padding: 16px;
  }

  > ai-dialog-footer {
    display: block;
    padding: 6px;
    border-top: 1px solid #e5e5e5;
    text-align: right;

    button {
      color: #333;
      background-color: #fff;

      padding: 6px 12px;
      font-size: 14px;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      -ms-touch-action: manipulation;
      touch-action: manipulation;
      cursor: pointer;
      background-image: none;
      border: 1px solid #ccc;
      border-radius: 4px;
      margin: 5px 0 5px 5px;

      &:disabled {
        cursor: default;
        opacity: 0.45
      }

      &:hover:enabled {
        color: #333;
        background-color: #e6e6e6;
        border-color: #adadad;
      }
    }
  }
}

.ai-dialog-open {
  overflow: hidden;
}
