/* Full-page Sales Report editor. Other pages and native sheets retain their
   existing scroll and action-bar layout. Shared button artwork stays unchanged. */
html:has([data-mobile-report-editor]),
body:has([data-mobile-report-editor]) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.mobile-shell-frame:has([data-mobile-report-editor]) {
  position: absolute;
  inset-inline: 0;
  top: var(--mobile-report-editor-top, 0px);
  height: var(--mobile-report-editor-height, 100dvh);
  min-height: 0;
  padding-bottom: 0;
}

.mobile-shell-frame:has([data-mobile-report-editor]) > .mobile-workspace-topbar {
  position: relative;
  top: auto;
  flex-shrink: 0;
}

.mobile-shell-frame:has([data-mobile-report-editor]) > .mobile-page-content {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 1.75rem;
}

.mobile-sales-report-page:has([data-mobile-report-editor]),
[data-mobile-report-editor] {
  flex: 1 1 0%;
  min-height: 0;
}

.mobile-sales-report-page:has([data-mobile-report-editor]) > :not([data-mobile-report-editor]) {
  flex-shrink: 0;
}

.mobile-report-editor-scroll {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  min-width: 0;
  /* Leave paint space for card rings and shadows without narrowing the fields. */
  margin-inline: -0.25rem;
  padding: 0.25rem;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-block: 0.75rem;
}

.mobile-report-editor-scroll > * {
  flex: 0 0 auto;
}

[data-mobile-report-editor] > .mobile-action-bar {
  position: static;
  flex: 0 0 auto;
  bottom: auto;
}

.mobile-report-keyboard-dismiss[data-mobile-report-editor-dismiss] {
  display: none;
}

.mobile-shell-frame[data-mobile-report-editor-keyboard="true"] [data-mobile-report-editor] > .mobile-action-bar {
  display: none;
}

.mobile-shell-frame[data-mobile-report-editor-keyboard="true"] .mobile-report-keyboard-dismiss {
  display: inline-flex;
}

.mobile-shell-frame:has([data-mobile-report-editor]) > #mobile_navigation_shell {
  flex-shrink: 0;
}

.mobile-shell-frame:has([data-mobile-report-editor]) #mobile_bottom_navigation {
  position: relative;
  inset: auto;
}

.mobile-shell-frame[data-mobile-report-editor-compact="true"]:has([data-mobile-report-editor]) #mobile_bottom_navigation {
  display: none;
}

.mobile-shell-frame[data-mobile-report-editor-compact="true"]:has([data-mobile-report-editor]) > .mobile-page-content {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

/* Short screens keep the keyboard-dismiss action reachable while typing. */
.mobile-shell-frame[data-mobile-report-editor-short="true"]:has([data-mobile-report-editor]) > .mobile-workspace-topbar {
  display: none;
}

.mobile-shell-frame[data-mobile-report-editor-short="true"][data-mobile-report-editor-keyboard="true"]:has([data-mobile-report-editor]) > .mobile-workspace-topbar {
  display: block;
}

.mobile-shell-frame[data-mobile-report-editor-short="true"]:has([data-mobile-report-editor]) > .mobile-page-content {
  padding-top: 0.5rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

.mobile-shell-frame[data-mobile-report-editor-short="true"] [data-mobile-report-editor] {
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .mobile-shell-frame[data-mobile-report-editor-short="true"] [data-mobile-report-editor] > .mobile-action-bar {
    flex-direction: row;
    align-items: center;
  }

  .mobile-shell-frame[data-mobile-report-editor-short="true"] [data-mobile-report-editor] > .mobile-action-bar > * {
    flex: 1 1 0%;
  }
}
