/* The page around the app, kept out of index.html because the CSP allows no
   inline style. Extends the react-native-web reset, as Expo's own template
   does. */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
/*
  The page itself never scrolls: it is exactly the screen, and the app
  scrolls inside it. A page taller than the screen let Safari drag the whole
  app up, past its foot, onto the page's background; and once scrolled, the
  header slid up under the status bar. overscroll-behavior stops the bounce
  on the page as well.
*/
html,
body {
  overflow: hidden;
  overscroll-behavior: none;
}
html {
  -webkit-text-size-adjust: 100%;
  /* The app's light background, until the app sets its own theme
     (src/libs/pageTheme.web.ts). Not the phone's setting: the app's theme
     is its own. */
  background-color: #fbfbf9;
}
body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#root {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background-color: var(--color-background, #fbfbf9);
}
@media (min-width: 441px) {
  #root {
    box-shadow: 0 0 40px -10px rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(128, 128, 128, 0.15);
    border-right: 1px solid rgba(128, 128, 128, 0.15);
  }
}
/* React Native Web portals Modal directly to <body> */
[aria-modal="true"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
[aria-modal="true"] > div {
  width: 100% !important;
  max-width: 440px !important;
  height: 100% !important;
  margin: 0 auto !important;
  position: relative !important;
}
/* Clamp viewport-width utilities so desktop browsers do not blow up padding/margins */
.px-\[5vw\] {
  padding-left: min(5vw, 22px) !important;
  padding-right: min(5vw, 22px) !important;
}
.mx-\[5vw\] {
  margin-left: min(5vw, 22px) !important;
  margin-right: min(5vw, 22px) !important;
}
.px-\[8vw\] {
  padding-left: min(8vw, 35px) !important;
  padding-right: min(8vw, 35px) !important;
}
.h-\[80vw\] {
  height: min(80vw, 352px) !important;
}
.min-w-\[40vw\] {
  min-width: min(40vw, 176px) !important;
}
.min-w-\[30vw\] {
  min-width: min(30vw, 132px) !important;
}
.noscript {
  margin: 10%;
  font: 18px/1.5 sans-serif;
  direction: rtl;
}

/* Button texts must not be selectable */
button,
[role="button"],
[role="button"] * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

input,
textarea,
select,
[role="textbox"],
[contenteditable="true"] {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible,
[role="textbox"]:focus,
[role="textbox"]:focus-visible,
[contenteditable="true"]:focus,
[contenteditable="true"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
