:root {
  --ivt-viewport-width: 100vw;
  --ivt-viewport-height: 100dvh;
  --ivt-keyboard-height: 0px;
}

html[data-ivt-device="mobile"] {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-ivt-device="mobile"] body {
  min-height: var(--ivt-viewport-height, 100dvh);
}

html[data-ivt-input="touch"] :where(button, input, select, summary, [role="button"]) {
  touch-action: manipulation;
}

html[data-ivt-input="touch"] :where(
  .button,
  .navbar-toggle,
  .navbar-link,
  .navbar-more-link,
  .language-current,
  .language-option,
  .footer-link,
  .dialog-close
) {
  min-block-size: 44px;
}

html[data-ivt-device="mobile"] .page-shell {
  width: min(var(--content-max), calc(100% - 1rem));
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
}

html[data-ivt-device="mobile"] .site-footer {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

html[data-ivt-device="mobile"] .info-dialog {
  width: min(460px, calc(100% - 1rem));
  max-height: calc(var(--ivt-viewport-height, 100dvh) - 1rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

html[data-ivt-keyboard="open"] .info-dialog {
  max-height: calc(var(--ivt-viewport-height, 100dvh) - 0.5rem);
}

html[data-ivt-reduced-motion="true"] *,
html[data-ivt-reduced-motion="true"] *::before,
html[data-ivt-reduced-motion="true"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
