*, *:before, *:after {
  box-sizing: border-box;
}

.wae-modal {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  display: none;
  padding: 0 20px 2em 20px;
  z-index: 2;
}
  
.wae-modal-frame {
  background-color: #fff;
  color: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  width: 500px;
  max-width: calc(100vw - 2em);
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  
  padding: 2em;
  position: absolute;
  margin-bottom: 2em;
}

.wae-modal [rel=wae-modal-title] {
  position: relative;
  line-height: 0;
  margin: -1.3333333em -1.3333333em 1.3333333em -1.3333333em;
  padding: 1.5em 1em;
  cursor: move;
  font-size: 150%;
  background-color: rgba(0, 0, 0, 0.1);
}

.wae-modal [rel=wae-modal-title]:hover {
  background-color: rgba(0, 0, 0, 1.0);
  color: white;

}

.wae-modal [rel=wae-modal-close]:hover {
  font-weight: bold;
}

.wae-modal [rel=wae-modal-close] {
  position: absolute;
  top: 1em;
  right: 1em;
  line-height: 1em;
  cursor: pointer;
}

.wae-modal .content {
  padding: 0;
}

.wae-modal .content::after {
  content: '';
  clear: both;
  display: block;
}

.wae-modal [rel=wae-modal-close]:after {
  content: '\2715';
}

.wae-modal [rel=wae-modal-buttons] {
  background-color: rgba(0, 0, 0, 0.1);
  margin: 2em -2em -2em -2em;
  padding: 1em 2em;  
  text-align: right;
}

.wae-modal [rel=wae-modal-buttons] button[type=link] {
  background-color: white;
  color: rgba(0, 0, 0, 0.7);
}

.wae-modal [rel=wae-modal-buttons] * {
  margin-left: 0.5em;
}

/*

.wae-modal [rel=wae-modal-buttons] button:hover {
  background-color: silver;
  color: rgba(0, 0, 0, 0.7);
}

*/

/* Placed on the body while a modal is open to prevent scrolling. */
.wae-modal.visible {
  overflow: hidden;
}

.showing-modal {
  overflow: hidden;
}

/* So the scrollbar calculation is correct. */
body {
  margin: 0;
  padding: 0;
}

#wae-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}