:host {
  --dlg-width: fit-content;
  --dlg-max-width: 80dvw;
  --dlg-height: fit-content;
  --dlg-max-height: 80dvh;
  --dlg-background-color: #fff;
  --dlg-header-background-color: #ddd;
  --dlg-title-color: inherit;
  --dlg-close-color: inherit;
  --dlg-close-hover-color: #666;
  --dlg-backdrop-color: rgba(0, 0, 0, 0.5);
  --dlg-content-width: auto;

}

h2,
h3,
button {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
  vertical-align: baseline;
}

h2,
h3 {
  font-size: 1em;
  font-weight: inherit;
  font-style: inherit;
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  font-size: 1rem;
  background-color: transparent;
  color: inherit;
  display: block;
  outline: none;
}

dialog {
  outline: none;
  border: none;
  border-radius: 0.5rem;
  padding: 0;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  overflow-y: hidden;
  max-width: var(--dlg-max-width);
  width: var(--dlg-width);
  max-height: var(--dlg-max-height);
  background-color: var(--dlg-background-color);
  height: var(--dlg-height);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 2rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid #ccc;
  gap: 2rem;
  background-color: var(--dlg-header-background-color);
  font-size: 1.5rem;

  .title {
    color: var(--dlg-title-color);
    font-size: inherit;
  }

  button.close {
    background: none;
    border: none;
    cursor: pointer;
    border: 0;
    color: var(--dlg-close-color);
    margin: 0;
    padding: 0;

    &:hover {
      color: var(--dlg-close-hover-color);
    }

    .close-icon {
      width: 1rem;
      height: 1rem;
    }
  }
}

.content {
  max-height: calc(min(var(--dlg-height), var(--dlg-max-height)) - 1rem - 1.5rem - 1rem - 2rem - 2rem);
  /* height - header - padding */
  width: var(--dlg-content-width);
  overflow-y: auto;
  margin-bottom: 2rem;
  padding: 0 2rem;
}

::backdrop {
  background: var(--dlg-backdrop-color);
}