html, body, #root {
  background: #000;
  color-scheme: dark;
}

html.llamas-mobile-viewport {
  --llamas-content-height: 100%;
  --llamas-keyboard-safe-bottom: env(safe-area-inset-bottom, 0px);
  height: 100%;
  overflow: hidden;
}
html.llamas-mobile-viewport body {
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

/* Native fixed edges keep following Safari when a viewport event is missed. */
html.llamas-mobile-viewport #root {
  position: fixed;
  inset: 0;
  height: auto;
  max-height: none;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
html.llamas-mobile-viewport #root > div {
  min-height: 0;
  min-width: 0;
}
html.llamas-mobile-viewport:not(.llamas-keyboard-open) #llamas-admin162 {
  top: 0;
  bottom: 0;
  height: auto;
  max-height: none;
}
html.llamas-mobile-viewport .llamas-viewport-modal {
  top: 0;
  bottom: 0;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
html.llamas-mobile-viewport :is(input, textarea, select, [contenteditable=true]) {
  font-size: 16px !important;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

/* Numeric visualViewport bounds are needed only above the software keyboard. */
html.llamas-keyboard-open {
  --llamas-content-height: var(--llamas-viewport-height, 100dvh);
  --llamas-keyboard-safe-bottom: 0px;
}
html.llamas-keyboard-open #root,
html.llamas-keyboard-open .llamas-viewport-modal {
  top: var(--llamas-viewport-top, 0px);
  bottom: auto;
  height: var(--llamas-viewport-height, 100dvh);
  max-height: var(--llamas-viewport-height, 100dvh);
}

@media all and (display-mode: standalone) {
  html.llamas-mobile-viewport #root {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: var(--llamas-keyboard-safe-bottom);
    box-sizing: border-box;
  }
  html.llamas-mobile-viewport:not(.llamas-keyboard-open) #llamas-admin162 {
    top: env(safe-area-inset-top, 0px);
  }
  html.llamas-keyboard-open {
    --llamas-content-height: calc(var(--llamas-viewport-height, 100dvh) - env(safe-area-inset-top, 0px));
  }
}
