/* Shared responsive safety layer for the public site and both application panels. */
:root {
  --bdf-mobile-gutter: 16px;
  --bdf-mobile-gutter-left: max(var(--bdf-mobile-gutter), env(safe-area-inset-left, 0px));
  --bdf-mobile-gutter-right: max(var(--bdf-mobile-gutter), env(safe-area-inset-right, 0px));
}

html {
  box-sizing: border-box;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  min-width: 0;
  max-width: 100%;
}

img,
picture,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img,
picture,
video,
svg {
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

textarea {
  resize: vertical;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code,
kbd,
samp,
a {
  overflow-wrap: anywhere;
}

[role="dialog"],
dialog {
  max-width: calc(100vw - var(--bdf-mobile-gutter-left) - var(--bdf-mobile-gutter-right));
  max-height: calc(100dvh - 24px);
}

@media (max-width: 900px) {
  :root {
    --bdf-mobile-gutter: 14px;
  }

  html,
  body {
    width: 100%;
    overflow-x: clip;
  }

  :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, label, legend, figcaption, blockquote, a, button) {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  :where(table, iframe, object, embed) {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  :root {
    --bdf-mobile-gutter: 12px;
  }
}
