/* Mobile-first shell — default layout = phone; desktop = centered column */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  margin: 0;
}

body {
  background: #e8e8e8;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#screens {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #f5f5f5;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Presell #zero: full-bleed TikTok look (no gray phone shell) */
body:has(#zero.screen.is-active) {
  background: #ffffff;
}

#screens:has(#zero.screen.is-active) {
  max-width: 100%;
  width: 100%;
  box-shadow: none;
  background: transparent;
}

#zero.screen.is-active {
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#zero .card {
  max-width: 100%;
  width: 100%;
}

#zero #bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Prevent iOS zoom on focus */
input,
select,
textarea,
.nome-completo,
#pix-key-input,
#nome,
#email {
  font-size: 16px !important;
}

/* Touch targets (Apple HIG ~44px) */
.btn-sacar,
.btn-obrigado,
.btn-sacar-dois,
.btn-vincular,
.btn-concluido,
#zero #claimBtn.btn-claim,
#zero #claimBtn.btn-claim.visible,
.pix-item,
.btn-three-saque,
#btn-enviar-pix {
  min-height: 44px;
}

#zero #claimBtn.btn-claim {
  min-height: 52px;
  padding-top: 15px;
  padding-bottom: 15px;
}

.pix-item {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Sticky bar: full width on phone, safe home indicator */
.sticky-popup {
  max-width: 100%;
  width: 100%;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
}

@media (min-width: 431px) {
  .sticky-popup {
    max-width: 430px;
  }
}

.saldo-popup {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

/* Full-screen steps constrained on large viewports */
#seven.is-active,
#seven.screen.is-active {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  height: 100svh;
}

/* Modals / bottom sheets */

/* Horizontal overflow guards */
.screen.is-active,
.bloco-dois,
.container-saldo,
.parabens,
.day-tracker {
  max-width: 100%;
  box-sizing: border-box;
}

.valor-currency,
.saldo-valor {
  overflow-wrap: anywhere;
  word-break: break-word;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 380px) {
  .parabens-img {
    width: 120px;
    height: 120px;
  }

  #zero h1 {
    font-size: 19px;
  }

  .container-saldo {
    flex-wrap: wrap;
    gap: 12px;
  }

  .btn-sacar {
    width: 100%;
  }
}