/* this css copied/derived from WAI ARIA modal dialog example - https://w3c.github.io/aria-practices/examples/dialog-modal/css/dialog.css */

[role="alertdialog"],
[role="dialog"] {
  box-sizing: border-box;
  /* removed: padding: 15px;*/
  border: 1px solid #000;
  background-color: #fff;
  min-height: 100vh;
  /* added */
  display: flex;
  flex-direction: column;
  max-height: 100vh;
}

@media screen and (min-width: 600px) {
    [role="alertdialog"],
    [role="dialog"] {
      position: absolute;
      top: 2rem;
      left: 50vw; /* move to the middle of the screen (assumes relative parent is the body/viewport) */
      transform: translateX(
        -50%
      ); /* move backwards 50% of this element's width */
  
      min-width: calc(640px - (15px * 2)); /* == breakpoint - left+right margin */
      min-height: auto;
      box-shadow: 0 19px 38px rgba(0, 0, 0, 0.12), 0 15px 12px rgba(0, 0, 0, 0.22);
      /* added: max-height so that the box stops the same distance from the edge that it starts */
      max-height: calc(100% - 4rem);
    }
}

.dialog_label {
  text-align: center;
}

.dialog_form {
  margin: 15px;
}

.dialog_form .label_text {
  box-sizing: border-box;
  padding-right: 0.5em;
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  width: 30%;
  text-align: right;
}

.dialog_form .label_info {
  box-sizing: border-box;
  padding-right: 0.5em;
  font-size: 12px;
  width: 30%;
  text-align: right;
  display: inline-block;
}

.dialog_form_item {
  margin: 10px 0;
  font-size: 0;
}

.dialog_form_item .wide_input {
  box-sizing: border-box;
  max-width: 70%;
  width: 27em;
}

.dialog_form_item .city_input {
  box-sizing: border-box;
  max-width: 70%;
  width: 17em;
}

.dialog_form_item .state_input {
  box-sizing: border-box;
  max-width: 70%;
  width: 15em;
}

.dialog_form_item .zip_input {
  box-sizing: border-box;
  max-width: 70%;
  width: 9em;
}

.dialog_form_actions {
  text-align: right;
  padding: 0 20px 20px;
}

.dialog_close_button {
  float: right;
  position: absolute;
  top: 10px;
  left: 92%;
  height: 25px;
}

.dialog_close_button img {
  border: 0;
}

.dialog_desc {
  padding: 10px 20px;
}

/* native <dialog> element uses the ::backdrop pseudo-element */

/* dialog::backdrop, */
.dialog-backdrop {
  display: none;
  position: fixed;
  overflow-y: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

@media screen and (min-width: 640px) {
  .dialog-backdrop {
    background: rgba(0, 0, 0, 0.3);
  }
}

.dialog-backdrop.active {
  display: block;
}

.no-scroll {
  overflow-y: auto !important;
}

/* this is added to the body when a dialog is open */
.has-dialog {
  overflow: hidden;
}

/* styling for alert-dialog example */
.notes {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
  min-width: 400px;
  max-width: 100%;
  width: 33%;
}

.toast {
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 0.25rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  position: fixed;
  top: 1rem;
  right: 1rem;
  transform: translateY(-150%);
  transition: transform 225ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.active {
  transform: translateY(0);
}

/* added code */
.dialog-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  border-bottom: 2px solid #333;
  margin: 0;
  padding: 20px 30px 10px;
  position: sticky;
  top: 0;
}
.dialog-top h2 {
  border: none;
  margin: 0;
  flex-grow: 1;
  padding-bottom: 0;
}
.dialog-content {
  padding-top: 20px;
  overflow-y: auto;
  margin: 30px;
  margin-top: 0;
}
[role="dialog"] {
  font-size: 16px;
}
[role="dialog"] div div {
  margin: 10px;
}
[role="dialog"] div div button {
  margin: 0;
}