/* Round21: constrain phone scrolling to the page's main content region. */
@media (max-width: 700px) {
  html[data-mobile-shell-ready="true"] {
    width: var(--mobile-shell-width, 100vw);
    height: var(--mobile-shell-height, 100dvh);
    min-height: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
    background: #f2f2f7;
  }

  html[data-mobile-shell-ready="true"] body {
    position: fixed !important;
    top: var(--mobile-shell-top, 0px) !important;
    left: var(--mobile-shell-left, 0px) !important;
    width: var(--mobile-shell-width, 100vw) !important;
    height: var(--mobile-shell-height, 100dvh) !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: hidden !important;
    overscroll-behavior: none;
    background: #f2f2f7;
  }

  html[data-mobile-shell-ready="true"] main {
    position: relative;
    display: flex !important;
    flex-direction: column;
    box-sizing: border-box !important;
    width: min(100%, 440px) !important;
    max-width: 440px !important;
    height: var(--mobile-shell-main-height, calc(100dvh - 88px)) !important;
    min-height: 0 !important;
    max-height: var(--mobile-shell-main-height, calc(100dvh - 88px)) !important;
    flex: none !important;
    margin: 0 auto !important;
    padding: calc(env(safe-area-inset-top) + 8px) 12px calc(env(safe-area-inset-bottom) + 8px) !important;
    overflow-x: hidden !important;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    scrollbar-gutter: stable;
  }

  html[data-mobile-shell-ready="true"] main[data-mobile-scrollable="false"] {
    overflow-y: hidden !important;
  }

  html[data-mobile-shell-ready="true"] main[data-mobile-modal-locked="true"] {
    overflow: hidden !important;
  }

  html[data-mobile-shell-ready="true"] #sendbar {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: var(--mobile-shell-bottom-gap, 0px) !important;
    left: var(--mobile-shell-left, 0px) !important;
    box-sizing: border-box !important;
    width: var(--mobile-shell-width, 100vw) !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 30;
  }

  html[data-mobile-shell-ready="true"] #sender-nav {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: var(--mobile-shell-nav-bottom, 0px) !important;
    left: var(--mobile-shell-left, 0px) !important;
    box-sizing: border-box !important;
    width: var(--mobile-shell-width, 100vw) !important;
    max-width: 440px !important;
    margin: 0 auto !important;
  }

  html[data-mobile-shell-ready="true"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]),
  html[data-mobile-shell-ready="true"] textarea,
  html[data-mobile-shell-ready="true"] select {
    font-size: 16px !important;
  }

  html[data-mobile-shell-ready="true"] #mobile-build-version.mobile-build-version {
    display: block;
    width: 100%;
    margin: 12px auto 4px;
    color: #8e8e93;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    user-select: text !important;
    -webkit-user-select: text !important;
    touch-action: pan-y pinch-zoom;
  }

  html[data-mobile-shell-ready="true"][data-mobile-modal-open="true"] main {
    overflow: hidden !important;
  }

  html[data-mobile-shell-ready="true"] #class-sheet,
  html[data-mobile-shell-ready="true"] #countdown-sheet,
  html[data-mobile-shell-ready="true"] #duty-sync-dialog,
  html[data-mobile-shell-ready="true"] #acct-register-confirm {
    position: fixed !important;
    inset: auto !important;
    top: var(--mobile-shell-top, 0px) !important;
    left: var(--mobile-shell-left, 0px) !important;
    width: var(--mobile-shell-width, 100vw) !important;
    height: var(--mobile-shell-height, 100dvh) !important;
    max-width: none !important;
    max-height: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
  }

  html[data-mobile-shell-ready="true"] #class-sheet .sheet,
  html[data-mobile-shell-ready="true"] #countdown-sheet .sheet,
  html[data-mobile-shell-ready="true"] #duty-sync-dialog .duty-sync-sheet,
  html[data-mobile-shell-ready="true"] .acct-reg-confirm__dialog {
    max-height: calc(var(--mobile-shell-height, 100dvh) - 12px) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  html[data-mobile-shell-ready="true"] #duty-sync-dialog .duty-sync-sheet {
    height: min(94%, 960px);
    overflow: hidden !important;
  }

  html[data-mobile-shell-ready="true"] #duty-sync-dialog .duty-sync-body {
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  html[data-mobile-shell-ready="true"] dialog[open] {
    max-height: calc(var(--mobile-shell-height, 100dvh) - 24px) !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  html[data-mobile-shell-ready="true"] .touch-clock,
  html[data-mobile-shell-ready="true"] .shared-clock-dialog {
    max-height: calc(var(--mobile-shell-height, 100dvh) - 24px) !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }

  html[data-mobile-shell-ready="true"] .timer-wheel,
  html[data-mobile-shell-ready="true"] .clock-wheels > div {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }
}
