/*
 * Android WebView compatibility layer.
 * Rules are scoped to html.app-android-client and intentionally avoid changing
 * the established desktop/iOS appearance.
 */

html.app-android-client {
  width: 100%;
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html.app-android-client body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

@supports (height: 100dvh) {
  html.app-android-client body {
    min-height: 100dvh;
  }
}

html.app-android-client img,
html.app-android-client svg,
html.app-android-client video,
html.app-android-client canvas {
  max-width: 100%;
}

html.app-android-client button,
html.app-android-client input,
html.app-android-client select,
html.app-android-client textarea {
  min-width: 0;
  max-width: 100%;
}

html.app-android-client body,
html.app-android-client .app-shell,
html.app-android-client .shuiming-shell,
html.app-android-client .page-content,
html.app-android-client .content,
html.app-android-client .main,
html.app-android-client .mine-stack {
  overflow-wrap: break-word;
}

/* Keep very narrow phones from squeezing navigation and form controls. */
@media (max-width: 359px) {
  html.app-android-client body .bottom-nav {
    left: 10px !important;
    right: 10px !important;
  }

  html.app-android-client body .nav-item {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html.app-android-client .form-row,
  html.app-android-client .buyer-grid,
  html.app-android-client .ecard-row,
  html.app-android-client .settings-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Keep short landscape screens scrollable instead of clipping fixed content. */
@media (max-height: 560px) and (orientation: landscape) {
  html.app-android-client body {
    min-height: 100vh !important;
    overflow-y: auto !important;
  }

  html.app-android-client .bottom-nav {
    position: sticky !important;
    bottom: 0 !important;
  }
}

/* Some Android system fonts render selected controls with tiny glyphs. */
html.app-android-client select,
html.app-android-client input[type="date"],
html.app-android-client input[type="number"] {
  font-family: inherit;
  line-height: normal;
}

html.app-android-client input,
html.app-android-client textarea {
  -webkit-user-select: text;
  user-select: text;
}
