/* === Diário do Ice — app.css ===
   Visual: Liquid Glass + Aurora + Precision-Craft
   - Aurora canonical palette (TECSA blue + gold + Montserrat)
   - Liquid Glass surfaces: backdrop-filter blur + translucent layers + highlight reflexes
   - Precision-Craft: kicker pattern (gold uppercase letter-spaced), 8px scale,
     border-left blue cards, swiss CTA, AA contrast, focus rings.
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* === DESIGN TOKENS === */
:root {
  /* Aurora colors */
  --tecsa-blue:        #003C82;
  --tecsa-blue-deep:   #002B5C;
  --tecsa-blue-light:  #E6EDF5;
  --tecsa-gold:        #C5A55A;
  --tecsa-gold-soft:   #F5EFE0;
  --tecsa-black:       #231F20;
  --tecsa-gray:        #8A8C8E;
  --tecsa-gray-light:  #F5F5F5;
  --tecsa-bg:          #FFFFFF;
  --tecsa-error:       #B43D2D;

  /* Glass tokens */
  --glass-bg:          rgba(255, 255, 255, 0.55);
  --glass-bg-strong:   rgba(255, 255, 255, 0.78);
  --glass-bg-dark:     rgba(0, 60, 130, 0.32);
  --glass-border:      rgba(255, 255, 255, 0.65);
  --glass-border-dark: rgba(255, 255, 255, 0.18);
  --glass-shadow:      0 12px 40px -8px rgba(0, 30, 70, 0.28);
  --glass-shadow-soft: 0 6px 20px -6px rgba(0, 30, 70, 0.14);

  /* Spacing scale 8px */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Radii */
  --r-1: 4px; --r-2: 12px; --r-3: 20px; --r-4: 28px;

  /* Type */
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--tecsa-bg);
  color: var(--tecsa-black);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
  /* iOS/Android: previne flash azul ao tocar */
  -webkit-tap-highlight-color: transparent;
  /* Android: previne pull-to-refresh acidental */
  overscroll-behavior-y: none;
  /* iOS: scroll suave em listas internas */
  -webkit-overflow-scrolling: touch;
}
/* Buttons: tap mais rápido + sem zoom em duplo-toque */
button, a, .cta, .botao-foto, .botao-secundario, .salvar, .apagar {
  touch-action: manipulation;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--tecsa-gold);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

::selection { background: rgba(197, 165, 90, 0.4); color: var(--tecsa-black); }

/* === HERO BACKGROUND ===
   Removido: o fundo azul saiu por pedido do dono (2026-05-03).
   Mantido o seletor pra não quebrar o HTML (que ainda renderiza <div class="hero-bg">).
*/
.hero-bg { display: none; }

/* === LAYOUT === */
main {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--s-5) calc(var(--s-7) + 80px); /* espaço pro CTA fixo */
}

/* === TOPBAR (glass clara) === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  /* Safe area: respeita notch/Dynamic Island do iPhone */
  padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) var(--s-5) var(--s-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid #E8E8E8;
}
.wordmark {
  color: var(--tecsa-gray);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.wordmark-bar {
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--tecsa-gold);
}
.topbar .meta {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tecsa-gray);
  font-weight: 600;
}
.topbar a { color: inherit; }

/* === TABS (multi-criança) === */
.tabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  gap: var(--s-1);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: var(--s-2) var(--s-5);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid #E8E8E8;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 auto;
  min-width: 80px;
  padding: var(--s-2) var(--s-3);
  min-height: 36px;
  background: transparent;
  border: 1px solid #E8E8E8;
  color: var(--tecsa-gray);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-1);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tab:hover { border-color: var(--tecsa-blue); color: var(--tecsa-blue); }
.tab.active {
  background: var(--tecsa-blue);
  border-color: var(--tecsa-blue);
  color: white;
  box-shadow: 0 2px 8px -2px rgba(0, 60, 130, 0.4);
}
.tab.active::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--tecsa-gold);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* Tag de criança no /editar */
.crianca-tag {
  display: inline-block;
  background: var(--tecsa-blue-light);
  color: var(--tecsa-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: var(--s-2);
  text-transform: uppercase;
}

/* Select no editar */
.editar-row select {
  width: 100%;
  padding: var(--s-3);
  border: 1px solid #D0D0D0;
  background: var(--tecsa-gray-light);
  border-radius: var(--r-1);
  font-family: inherit;
  font-size: 16px;
  min-height: 44px;
  color: var(--tecsa-black);
}

/* === KICKER PATTERN (precision-craft) === */
.kicker {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tecsa-gold);
  font-weight: 700;
  margin-bottom: var(--s-2);
}

/* === HERO CARD (sólido após remoção do fundo azul) === */
.hero-card {
  margin-top: var(--s-5);
  padding: var(--s-5);
  background: #FAFAFA;
  border: 1px solid #E8E8E8;
  border-left: 3px solid var(--tecsa-blue);
  border-radius: var(--r-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px -4px rgba(0, 30, 70, 0.08);
  position: relative;
}
.hero-card .label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tecsa-gold);
  font-weight: 700;
  position: relative;
}
.hero-card .amount {
  margin-top: var(--s-2);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--tecsa-blue);
  font-variant-numeric: tabular-nums;
  position: relative;
}
.hero-card .amount .cents {
  font-size: 28px;
  vertical-align: top;
  margin-left: 2px;
  color: var(--tecsa-gold);
  font-weight: 600;
}
.hero-card .sub {
  margin-top: var(--s-2);
  color: var(--tecsa-black);
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.hero-card .sub strong { color: var(--tecsa-blue); font-weight: 700; }

/* === STATS STRIP (sólido) === */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--s-3);
  background: #FAFAFA;
  border: 1px solid #E8E8E8;
  border-radius: var(--r-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}
.stat-cell {
  padding: var(--s-3) var(--s-2);
  text-align: center;
  border-right: 1px solid rgba(0, 60, 130, 0.08);
}
.stat-cell:last-child { border-right: none; }
.stat-cell .l {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tecsa-gray);
  font-weight: 700;
}
.stat-cell .v {
  font-size: 20px;
  font-weight: 700;
  margin-top: var(--s-1);
  letter-spacing: -0.015em;
  color: var(--tecsa-blue);
  font-variant-numeric: tabular-nums;
}
.stat-cell .v small {
  font-size: 11px;
  color: var(--tecsa-gray);
  font-weight: 500;
}

/* === PHOTO CARD (escuro com Ice) === */
.photo-card {
  margin-top: var(--s-5);
  background: linear-gradient(155deg, #1A1410 0%, #2A1F18 100%);
  border-radius: var(--r-2);
  height: 200px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.photo-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 220px 120px at 30% 60%, rgba(197, 165, 90, 0.18), transparent),
    radial-gradient(circle at 80% 30%, rgba(0, 60, 130, 0.2), transparent 50%);
}
.photo-card.with-photo::before { display: none; }
.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-card .info {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  color: white;
  z-index: 2;
}
.photo-card .info-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tecsa-gold);
  font-weight: 700;
}
.photo-card .info-title {
  font-size: 18px;
  font-weight: 700;
  margin-top: var(--s-1);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.photo-card .info-meta {
  position: absolute;
  left: var(--s-4);
  bottom: var(--s-4);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  z-index: 2;
}

/* === CRONÔMETRO (passeio em curso) === */
.cronometro {
  text-align: center;
  padding: var(--s-6) 0;
}
.cronometro .tempo {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--tecsa-blue);
  line-height: 1;
}
.cronometro .desde {
  margin-top: var(--s-2);
  color: var(--tecsa-gray);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.cronometro .desde strong {
  color: var(--tecsa-gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* === EM CURSO BADGE === */
.em-curso-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--tecsa-gold);
  color: var(--tecsa-black);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: var(--s-1) var(--s-3);
  border-radius: 999px;
  margin-top: var(--s-5);
  box-shadow: var(--glass-shadow-soft);
}
.em-curso-badge .dot {
  width: 6px; height: 6px;
  background: var(--tecsa-blue);
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* === ALERTA (passeio em aberto há muito tempo) === */
.alerta {
  background: rgba(180, 61, 45, 0.08);
  border: 1px solid var(--tecsa-error);
  color: var(--tecsa-error);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-1);
  font-size: 13px;
  font-weight: 500;
  margin: var(--s-4) 0;
}

/* === SECTIONS === */
.section { margin-top: var(--s-6); }
.section h2 {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tecsa-gray);
  font-weight: 700;
  margin-bottom: var(--s-3);
}

/* === WALK ROW (cards de passeio na lista) === */
.walk-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--tecsa-bg);
  border: 1px solid #E8E8E8;
  border-left: 3px solid var(--tecsa-blue);
  border-radius: var(--r-1);
  margin-bottom: var(--s-2);
  align-items: center;
}
.walk-thumbs {
  display: flex;
  gap: var(--s-1);
}
.walk-thumb {
  width: 42px; height: 42px;
  border-radius: var(--r-1);
  background: linear-gradient(135deg, #2A2520, #3D3025);
  background-size: cover;
  background-position: center;
}
.walk-info .when {
  font-size: 14px;
  font-weight: 600;
  color: var(--tecsa-black);
}
.walk-info .meta {
  font-size: 11px;
  color: var(--tecsa-gray);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.walk-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--tecsa-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* === HISTÓRICO MENSAL === */
.historico-mes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) 0;
  font-size: 13px;
  border-bottom: 1px solid #E8E8E8;
}
.historico-mes:last-child { border-bottom: none; }
.historico-mes .nome {
  font-weight: 600;
  text-transform: capitalize;
  color: var(--tecsa-black);
}
.historico-mes .resumo {
  color: var(--tecsa-gray);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.historico-mes .resumo strong {
  color: var(--tecsa-blue);
  font-weight: 700;
}

/* === FOOTER NOTE === */
.footer-note {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  font-size: 11px;
  color: var(--tecsa-gray);
  text-align: center;
  border-top: 1px solid #E8E8E8;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* === CTA FIXO === */
.cta-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: var(--s-4) var(--s-5) max(var(--s-4), env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.95) 40%);
  z-index: 20;
}
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  max-width: 432px;
  background: var(--tecsa-blue);
  color: white;
  text-align: center;
  padding: var(--s-3) var(--s-4);
  min-height: 52px;
  border-radius: var(--r-2);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: auto;
  box-shadow: 0 8px 28px -6px rgba(0, 60, 130, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.cta-arrow {
  color: var(--tecsa-gold);
  font-size: 18px;
  position: relative;
}
.cta--encerrar {
  background: var(--tecsa-gold);
  color: var(--tecsa-black);
  box-shadow: 0 8px 28px -6px rgba(197, 165, 90, 0.5);
}
.cta--encerrar .cta-arrow { color: var(--tecsa-blue); }
.cta--disabled { opacity: 0.5; pointer-events: none; }

/* === TELA /passeio (captura) === */
.captura {
  padding-top: var(--s-6);
  text-align: center;
}
.captura h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tecsa-blue);
  margin-bottom: var(--s-2);
}
.captura .info-saida {
  color: var(--tecsa-gray);
  font-size: 13px;
  margin-bottom: var(--s-5);
  font-weight: 500;
}
.captura input[type="file"] { display: none; }
.captura .botao-foto {
  display: block;
  width: 100%;
  background: var(--tecsa-blue);
  color: white;
  padding: var(--s-7) var(--s-4);
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 28px -6px rgba(0, 60, 130, 0.45);
}
.captura .botao-foto::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.captura .preview {
  margin-top: var(--s-5);
}
.captura .preview img {
  width: 100%;
  border-radius: var(--r-2);
  box-shadow: var(--glass-shadow);
}
.captura .calculo {
  margin: var(--s-5) 0;
  text-align: center;
  padding: var(--s-5);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2);
}
.captura .calculo .duracao {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tecsa-blue);
  font-variant-numeric: tabular-nums;
}
.captura .calculo .valor {
  font-size: 44px;
  color: var(--tecsa-gold);
  font-weight: 700;
  margin-top: var(--s-2);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.captura .acoes {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-2);
  margin-top: var(--s-5);
  margin-bottom: var(--s-7);
}
.captura .botao-secundario {
  background: transparent;
  border: 1px solid var(--tecsa-blue);
  color: var(--tecsa-blue);
  padding: var(--s-3);
  border-radius: var(--r-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

/* === TELA /editar === */
.editar-row {
  padding: var(--s-4);
  border: 1px solid #E8E8E8;
  border-left: 3px solid var(--tecsa-blue);
  border-radius: var(--r-1);
  margin-bottom: var(--s-3);
  background: var(--tecsa-bg);
}
.editar-row.em-curso {
  border-left-color: var(--tecsa-gold);
}
.editar-row .header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-2);
}
.editar-row .id {
  font-weight: 700;
  color: var(--tecsa-blue);
}
.editar-row .status {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tecsa-gray);
  font-weight: 700;
  margin-left: var(--s-2);
}
.editar-row .status.aberto { color: var(--tecsa-gold); }
.editar-row .valor {
  font-size: 18px;
  font-weight: 700;
  color: var(--tecsa-blue);
  font-variant-numeric: tabular-nums;
}
.editar-row .meta {
  color: var(--tecsa-gray);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.editar-row label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tecsa-gray);
  font-weight: 700;
  margin: var(--s-3) 0 var(--s-1);
}
.editar-row input[type="datetime-local"] {
  width: 100%;
  padding: var(--s-3);
  border: 1px solid #D0D0D0;
  background: var(--tecsa-gray-light);
  border-radius: var(--r-1);
  font-family: inherit;
  /* iOS: 16px+ previne auto-zoom no foco */
  font-size: 16px;
  min-height: 44px;
  color: var(--tecsa-black);
}
.editar-row .botoes {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.editar-row .salvar {
  background: var(--tecsa-blue);
  color: white;
  border: 0;
  padding: var(--s-3) var(--s-5);
  /* Touch target mínimo 44pt (Apple HIG) */
  min-height: 44px;
  border-radius: var(--r-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.editar-row .apagar {
  background: transparent;
  color: var(--tecsa-error);
  border: 1px solid var(--tecsa-error);
  padding: var(--s-3) var(--s-5);
  min-height: 44px;
  border-radius: var(--r-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

/* === ESTADO DE ERRO/LOADING === */
.estado-msg {
  padding: var(--s-5);
  text-align: center;
  color: var(--tecsa-gray);
  font-size: 14px;
}
.estado-msg.erro { color: var(--tecsa-error); }

/* === RESPONSIVE ===
   Cobertura validada em todos iPhones em circulação (até iPhone 17 Pro Max):
   - 320×568   iPhone SE 1ª geração
   - 375×667   iPhone SE 2/3, 6/7/8, 12/13 Mini
   - 375×812   iPhone X, XS, 11 Pro
   - 390×844   iPhone 12, 12 Pro, 13, 13 Pro, 14
   - 393×852   iPhone 14/15/16 Pro
   - 402×874   iPhone 16 Pro (novo) — Dynamic Island maior
   - 414×896   iPhone XR, 11, 11 Pro Max, 14 Plus
   - 428×926   iPhone 12/13/14 Pro Max
   - 430×932   iPhone 14/15/16 Pro Max
   - 440×956   iPhone 16 Pro Max / 17 Pro Max esperado
   - 768+      iPad e tablets — limita largura, centraliza
   Safe areas via env(safe-area-inset-*) tratadas no .topbar e .cta-bar.
   Dynamic Island (14 Pro+) automaticamente respeitada via env(safe-area-inset-top).
*/

/* === iPhone SE 320px (menor extremo — apertado) === */
@media (max-width: 320px) {
  :root { --s-5: 12px; }
  main { padding-left: var(--s-3); padding-right: var(--s-3); }
  .topbar { padding-left: var(--s-3); padding-right: var(--s-3); }
  .hero-card { padding: var(--s-4); }
  .hero-card .amount { font-size: 38px; }
  .hero-card .amount .cents { font-size: 18px; }
  .stat-cell .v { font-size: 17px; }
  .photo-card { height: 160px; }
  .cronometro .tempo { font-size: 36px; }
  .captura h1 { font-size: 22px; }
  .captura .calculo .valor { font-size: 32px; }
  .wordmark { font-size: 14px; }
}

/* === iPhone padrão (321-374px) — Android compacto e SE 1 base === */
@media (min-width: 321px) and (max-width: 374px) {
  :root { --s-5: 16px; }
  main { padding-left: var(--s-4); padding-right: var(--s-4); }
  .topbar { padding-left: var(--s-4); padding-right: var(--s-4); }
  .hero-card .amount { font-size: 44px; }
  .hero-card .amount .cents { font-size: 22px; }
  .stat-cell .v { font-size: 18px; }
  .cronometro .tempo { font-size: 40px; }
  .captura h1 { font-size: 24px; }
  .captura .calculo .valor { font-size: 36px; }
}

/* === iPhone Pro Max class (430px+) — usa largura extra com presença visual === */
@media (min-width: 430px) {
  main, .topbar, .cta-bar > .cta {
    max-width: 480px;
  }
  .hero-card { padding: var(--s-6); }
  .hero-card .amount { font-size: 64px; }
  .hero-card .amount .cents { font-size: 32px; }
  .photo-card { height: 220px; }
  .cronometro .tempo { font-size: 56px; }
  .stat-cell .v { font-size: 22px; }
  .captura h1 { font-size: 32px; }
  .captura .calculo .valor { font-size: 52px; }
  /* CTA com mais altura no Pro Max — touch ainda mais confortável */
  .cta { min-height: 56px; padding: var(--s-4) var(--s-5); }
}

/* === iPad / tablets (centraliza coluna, sem esticar) === */
@media (min-width: 768px) {
  main, .topbar, .cta-bar > .cta {
    max-width: 520px;
  }
  .photo-card { height: 260px; }
}

/* === Modo paisagem em celulares — comprime altura === */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-card { padding: var(--s-3) var(--s-5); }
  .hero-card .amount { font-size: 36px; }
  .hero-card .amount .cents { font-size: 18px; }
  .photo-card { height: 140px; }
  .cronometro { padding: var(--s-3) 0; }
  .cronometro .tempo { font-size: 32px; }
}

/* === PWA standalone: prevenir pull-to-refresh === */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: contain; }
}

/* === iOS Dynamic Island (iPhone 14 Pro+, 15 Pro, 16 Pro, 17 Pro):
   safe-area-inset-top é maior (~59px) — respeitar no topbar de PWA standalone */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (display-mode: standalone) {
    .topbar { padding-top: max(var(--s-4), env(safe-area-inset-top)); }
  }
}

/* === Reduced motion (acessibilidade — todos iOS suportam) === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
