/*
 * ASHISH V55 — static-package guardrails
 * Keeps the legacy client shell intact while making its existing overlays
 * fit narrow RTL viewports and preventing two navigation layers from stacking.
 */
html,
body {
  max-width: 100%;
  overflow-x: clip !important;
}

body {
  min-width: 0 !important;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

#ashSheet,
.ash-sheet {
  box-sizing: border-box !important;
  width: min(100%, 600px) !important;
  max-width: 100vw !important;
  max-height: min(92dvh, 780px) !important;
  margin-inline: auto !important;
  overflow: hidden !important;
  overscroll-behavior: contain;
}

#ashSheetBody,
.ash-sheet #ashSheetBody,
.ash-sheet .sheet-body {
  min-width: 0 !important;
  max-height: calc(min(92dvh, 780px) - 72px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ashv46-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  min-width: 0;
}

.ashv46-field,
.ashv46-field input,
.ashv46-field textarea,
.ashv46-field select {
  min-width: 0 !important;
}

.ashv46-field input[type="file"] {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ash-v46-sheet-open #ashApp > .ash-bottom-nav,
body.ash-overlay-open #ashApp > .ash-bottom-nav,
body.ash-packaging-sheet-open #ashApp > .ash-bottom-nav,
body.ash-packaging-sheet-open #gsBottomBar,
body.ash-packaging-sheet-open #av15BottomNav,
body.ash-packaging-sheet-open #v48BottomBar,
body.ash-packaging-sheet-open .floating-bottom-bar,
body.ash-packaging-sheet-open .mobile-bottom-nav {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.ash-packaging-sheet-open {
  overflow: hidden !important;
  touch-action: none;
}

body.ash-packaging-sheet-open #ashSheetBody {
  touch-action: pan-y;
}

@media (max-width: 560px) {
  #ashSheet,
  .ash-sheet {
    inset-inline: 0 !important;
    width: 100% !important;
    max-height: 94dvh !important;
    border-radius: 22px 22px 0 0 !important;
  }

  #ashSheetBody,
  .ash-sheet #ashSheetBody,
  .ash-sheet .sheet-body {
    max-height: calc(94dvh - 68px) !important;
    padding-inline: 16px !important;
  }

  .ashv46-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ashv46-field.full {
    grid-column: auto !important;
  }

  .ashv46-submit-wrap {
    margin-inline: -16px !important;
    padding-inline: 16px !important;
  }
}

@media (max-width: 380px) {
  #ashSheetBody,
  .ash-sheet #ashSheetBody,
  .ash-sheet .sheet-body {
    padding-inline: 12px !important;
  }

  .ashv46-submit-wrap {
    margin-inline: -12px !important;
    padding-inline: 12px !important;
  }
}