/* Keep the existing React Native Web screens, but size their shared browser shell responsively. */
html,
body,
#root {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

* {
  box-sizing: border-box;
}

body {
  background: #eef2f6;
  font-family: Arial, Helvetica, sans-serif;
}

#root {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Every outer RN wrapper must fill the viewport so the desktop shell is not capped by an ancestor. */
#root > div {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
}

/* Shrinking flex children may wrap inside the page instead of forcing horizontal scrolling. */
#root > div > div {
  min-width: 0;
}

/* Server-rendered content shares the full-width canvas while the interactive reader loads. */
.web-fallback { width: 100%; margin: 0; padding: 24px; background: #fff; color: #18212c; }
.web-fallback h1 { font-size: 28px; line-height: 1.4; overflow-wrap: anywhere; }
.web-fallback a { color: #bd0019; }
.web-fallback img { display: block; width: 100%; height: auto; }
.web-story-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 18px; line-height: 1.7; margin-top: 20px; }

/* Play download surfaces share the existing red/white brand without a browser-install action. */
.tpn-play-link {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  color: #17212b; background: #fff; border: 1px solid #e2e5e9; border-radius: 8px;
  text-decoration: none; min-width: 0; width: 100%;
}
.tpn-play-link img, .tpn-promo-heading img { flex: 0 0 auto; object-fit: contain; border-radius: 8px; }
.tpn-play-copy { display: grid; gap: 4px; min-width: 0; }
.tpn-play-copy strong { font-size: 15px; line-height: 1.35; }
.tpn-play-copy > span { font-size: 13px; line-height: 1.4; color: #b90016; }
.tpn-play-arrow { font-size: 24px; margin-left: auto; color: #c70016; }
.tpn-play-link:hover { background: #fff6f7; border-color: #d60000; }

/* A non-modal prompt leaves the article readable and respects Android/iOS safe areas. */
.tpn-app-promo {
  position: fixed; z-index: 100; right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - 40px);
  overflow: auto; padding: 20px 16px 4px; color: #17212b; background: #fff;
  border: 1px solid #e0e3e8; border-top: 3px solid #d60000; border-radius: 8px;
  box-shadow: 0 8px 32px #17212b26; font-family: Arial, Helvetica, sans-serif;
}
/* One explicit gap separates the app details from the download action, even when copy wraps. */
.tpn-promo-heading { display: flex; align-items: center; gap: 12px; padding-right: 32px; margin: 0; }
.tpn-promo-heading h2 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
.tpn-promo-heading p { font-size: 14px; line-height: 1.4; color: #596573; margin: 0; }
.tpn-app-promo button { font-family: inherit; border: 0; cursor: pointer; }
.tpn-promo-close { position: absolute; top: 3px; right: 3px; width: 44px; height: 44px; background: transparent; color: #596573; font-size: 28px; }
.tpn-promo-download { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin-top: 24px; padding: 12px; border-radius: 6px; background: #d60000; color: #fff; text-decoration: none; font-size: 15px; font-weight: 700; line-height: 1.4; text-align: center; }
.tpn-promo-download:hover { background: #b90000; }
.tpn-promo-later { display: block; width: 100%; min-height: 44px; padding: 10px; background: transparent; color: #596573; font-size: 14px; }
.tpn-play-link:focus-visible, .tpn-app-promo :focus-visible { outline: 3px solid #1565c0; outline-offset: 3px; }
