*,
*::before,
*::after {
  box-sizing: border-box;
  line-height: calc(1em + 0.5rem);

  &:not(dialog) {
    margin: 0;
  }
}

img {
  display: block;
  max-width: 100%;
  object-fit: contain;

  p & {
    display: inline flow-root;
    max-block-size: 1cap;
    vertical-align: middle;
  }
}

input,
button,
textarea,
select {
  font: inherit;
}

:where(p, h1, h2, h3, h4, h5, h6) {
  overflow-wrap: break-word;
}

:where(p) {
  text-wrap: pretty;
}

:where(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}
