/* =========================================================================
   MyHealth — mockups de telas do app em HTML/CSS puro (frames de iPhone)
   Tokens do LUMEN (myhealth.css). Tamanhos internos em px (dispositivo fixo).
   Cada frame: role="img" + aria-label; DOM interno aria-hidden.
   ========================================================================= */

/* ---------- Frame (iPhone 17 Pro Max — 440×956 pt, bordas finas) ---------- */
.mh-phone{ width:312px; flex:none; border-radius:57px; padding:9px;
  background:linear-gradient(155deg,#5b6b82 0%,#1a2434 26%,#0B1524 60%,#2a3648 100%);
  box-shadow:var(--mh-e3), inset 0 1.5px 1px rgba(255,255,255,.22), inset 0 -1px 1px rgba(255,255,255,.08); }
.mh-phone__screen{ position:relative; background:var(--mh-canvas); border-radius:48px; overflow:hidden;
  aspect-ratio:440/956;
  font-family:var(--mh-font-body); font-size:12.5px; line-height:1.45; color:var(--mh-ink);
  display:flex; flex-direction:column; }
.mhp-island{ position:absolute; top:11px; left:50%; transform:translateX(-50%);
  width:94px; height:26px; border-radius:16px; background:#000; z-index:6; }
.mhp-status{ display:flex; justify-content:space-between; align-items:center;
  padding:16px 28px 4px; font-size:11.5px; font-weight:700; }
.mhp-status svg{ width:42px; height:11px; color:var(--mh-ink); }

.mhp-body{ flex:1; padding:10px 15px 14px; display:flex; flex-direction:column; gap:11px; overflow:hidden; }
.mhp-title{ font-family:var(--mh-font-display); font-weight:700; font-size:21px; letter-spacing:-.02em; }
.mhp-subtitle{ color:var(--mh-ink-3); font-size:11.5px; margin-top:1px; }
.mhp-back{ color:var(--mh-brand); font-size:12px; font-weight:600; }
.mhp-overline{ font-size:9px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--mh-ink-3); margin:4px 2px 0; }

/* ---------- Cards / linhas ---------- */
.mhp-card{ background:var(--mh-surface); border:1px solid var(--mh-hairline); border-radius:12px;
  box-shadow:var(--mh-e1); padding:11px 12px; }
.mhp-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mhp-row + .mhp-row{ margin-top:8px; padding-top:8px; border-top:1px solid var(--mh-hairline); }
.mhp-row__label{ font-weight:600; font-size:12px; }
.mhp-row__sub{ color:var(--mh-ink-3); font-size:10px; margin-top:1px; }
.mhp-num{ font-variant-numeric:tabular-nums; }

/* status pills menores dentro do phone */
.mh-phone .mh-status{ font-size:9.5px; padding:2px 7px 2px 6px; gap:5px; }
.mh-phone .mh-status::before{ width:6px; height:6px; }
.mhp-confirm{ font-style:italic; font-size:10px; color:var(--mh-action); font-weight:600; }

/* ---------- Progresso (jornada) ---------- */
.mhp-progress{ height:6px; border-radius:4px; background:var(--mh-surface-sunken); overflow:hidden; margin:8px 0 6px; }
.mhp-progress span{ display:block; height:100%; width:72%; border-radius:4px; background:var(--mh-brand); }

/* ---------- Sparklines ---------- */
.mhp-spark{ width:84px; height:24px; flex:none; }
.mhp-spark polyline{ fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.mhp-spark--up polyline{ stroke:var(--mh-watch); }
.mhp-spark--flat polyline{ stroke:var(--mh-ok); }
.mhp-spark--dip polyline{ stroke:var(--mh-watch); }

/* ---------- Métrica de marcador ---------- */
.mhp-metric{ display:flex; align-items:baseline; gap:5px; }
.mhp-metric b{ font-family:var(--mh-font-display); font-weight:700; font-size:17px; font-variant-numeric:tabular-nums; }
.mhp-metric span{ color:var(--mh-ink-3); font-size:10px; }

/* ---------- Tab bar ---------- */
.mhp-tabbar{ display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--mh-hairline);
  background:var(--mh-surface); padding:8px 6px 16px; }
.mhp-tab{ display:flex; flex-direction:column; align-items:center; gap:3px; color:var(--mh-ink-3);
  font-size:8.5px; font-weight:600; }
.mhp-tab svg{ width:18px; height:18px; }
.mhp-tab--active{ color:var(--mh-brand); }

/* ---------- Gráfico grande (Tendências) ---------- */
.mhp-hero-value{ display:flex; align-items:baseline; gap:6px; }
.mhp-hero-value b{ font-family:var(--mh-font-display); font-weight:700; font-size:30px; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.mhp-hero-value span{ color:var(--mh-ink-3); font-size:12px; }
.mhp-trendmeta{ display:flex; align-items:center; gap:6px; margin-top:4px; flex-wrap:wrap; }
.mhp-delta{ font-size:10px; font-weight:700; color:var(--mh-watch); }
.mhp-chart{ width:100%; height:auto; margin-top:6px; }
.mhp-chart .band{ fill:var(--mh-ok-weak); }
.mhp-chart .grid{ stroke:var(--mh-hairline); stroke-width:1; }
.mhp-chart .line{ fill:none; stroke:var(--mh-watch); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.mhp-chart .pt{ fill:var(--mh-surface); stroke:var(--mh-watch); stroke-width:2; }
.mhp-chart .axis{ font:600 8px var(--mh-font-body); fill:var(--mh-ink-3); }
.mhp-chart .val{ font:700 9px var(--mh-font-body); fill:var(--mh-ink); }
.mhp-edu{ background:var(--mh-brand-weak); border:1px solid #cdddfb; border-radius:12px; padding:10px 12px;
  font-size:11px; color:var(--mh-ink); line-height:1.5; }
.mhp-srcline{ font-size:9.5px; color:var(--mh-ink-3); }
/* animação de desenho da linha (gatilho .is-in) */
@media (prefers-reduced-motion:no-preference){
  .mhp-chart .line{ stroke-dasharray:420; stroke-dashoffset:420; }
  .is-in .mhp-chart .line{ animation:mh-draw 1.6s ease-out .25s forwards; }
  .mhp-chart .pt{ opacity:0; }
  .is-in .mhp-chart .pt{ animation:mh-pt .4s ease-out forwards; }
  .is-in .mhp-chart .pt:nth-of-type(1){ animation-delay:.5s; }
  .is-in .mhp-chart .pt:nth-of-type(2){ animation-delay:.8s; }
  .is-in .mhp-chart .pt:nth-of-type(3){ animation-delay:1.1s; }
  .is-in .mhp-chart .pt:nth-of-type(4){ animation-delay:1.4s; }
  .is-in .mhp-chart .pt:nth-of-type(5){ animation-delay:1.7s; }
}
@keyframes mh-draw{ to{ stroke-dashoffset:0; } }
@keyframes mh-pt{ to{ opacity:1; } }

/* ---------- Chat (Assistente) ---------- */
.mhp-chip{ display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border-radius:999px;
  background:var(--mh-surface-sunken); border:1px solid var(--mh-hairline); color:var(--mh-ink-2);
  font-size:9px; font-weight:600; }
.mhp-bubble{ max-width:86%; border-radius:14px; padding:9px 11px; font-size:11.5px; line-height:1.5; }
.mhp-bubble--user{ align-self:flex-end; background:var(--mh-brand); color:#fff; border-bottom-right-radius:4px; }
.mhp-bubble--ai{ align-self:flex-start; background:var(--mh-surface); border:1px solid var(--mh-hairline);
  box-shadow:var(--mh-e1); border-bottom-left-radius:4px; }
.mhp-bubble--ai .mhp-confirm{ display:inline; }
.mhp-bubble__foot{ display:flex; align-items:center; gap:5px; margin-top:7px; padding-top:7px;
  border-top:1px solid var(--mh-hairline); font-size:10px; font-weight:700; color:var(--mh-brand); }
.mhp-bubble__foot svg{ width:11px; height:11px; }
.mhp-sources{ align-self:flex-start; font-size:9px; }
.mhp-input{ display:flex; align-items:center; gap:8px; background:var(--mh-surface); border:1px solid var(--mh-hairline);
  border-radius:999px; padding:9px 6px 9px 14px; color:var(--mh-ink-3); font-size:11px; margin-top:auto; }
.mhp-send{ width:28px; height:28px; border-radius:50%; background-image:var(--mh-gradient-cta); flex:none;
  display:grid; place-items:center; color:#fff; }
.mhp-send svg{ width:13px; height:13px; }

/* ---------- Ingestão ---------- */
.mhp-scanline{ display:flex; align-items:center; gap:8px; font-size:11px; color:var(--mh-ink-2); font-weight:600; }
.mhp-scanline svg{ width:14px; height:14px; color:var(--mh-brand); }
.mhp-progress--scan span{ width:64%; background-image:var(--mh-gradient-cta); }
.mhp-doc{ display:flex; align-items:center; gap:9px; }
.mhp-doc__thumb{ width:34px; height:44px; border-radius:6px; background:var(--mh-surface-sunken);
  border:1px solid var(--mh-hairline); position:relative; flex:none; }
.mhp-doc__thumb::before,.mhp-doc__thumb::after{ content:""; position:absolute; left:6px; right:6px; height:2.5px;
  border-radius:2px; background:var(--mh-hairline); }
.mhp-doc__thumb::before{ top:9px; } .mhp-doc__thumb::after{ top:16px; right:12px; }
.mhp-check{ width:16px; height:16px; border-radius:5px; border:1.5px solid var(--mh-hairline); flex:none;
  display:grid; place-items:center; color:#fff; }
.mhp-check--on{ background:var(--mh-brand); border-color:var(--mh-brand); }
.mhp-check svg{ width:10px; height:10px; }
.mhp-consent{ background:var(--mh-surface-sunken); border:1px solid var(--mh-hairline); border-radius:10px;
  padding:8px 10px; font-size:9.5px; color:var(--mh-ink-2); line-height:1.5; }
.mhp-btn{ display:flex; align-items:center; justify-content:center; min-height:38px; border-radius:11px;
  font-weight:700; font-size:12px; }
.mhp-btn--primary{ background-image:var(--mh-gradient-cta); color:#fff; }
.mhp-btn--secondary{ background:var(--mh-brand-weak); color:var(--mh-brand); }
.mhp-btnrow{ display:grid; grid-template-columns:1.4fr 1fr; gap:8px; }

/* ---------- Carta ao Médico ---------- */
.mhp-langchips{ display:flex; gap:5px; }
.mhp-langchips span{ font-size:9px; font-weight:700; padding:3px 9px; border-radius:999px;
  border:1px solid var(--mh-hairline); color:var(--mh-ink-3); background:var(--mh-surface); }
.mhp-langchips .on{ background:var(--mh-brand); border-color:var(--mh-brand); color:#fff; }
.mhp-sheet{ background:var(--mh-surface); border:1px solid var(--mh-hairline); border-radius:10px;
  box-shadow:var(--mh-e2); padding:13px 14px; font-size:10px; line-height:1.5; }
.mhp-sheet__head{ border-bottom:1px solid var(--mh-hairline); padding-bottom:7px; margin-bottom:8px; }
.mhp-sheet__head b{ font-family:var(--mh-font-display); font-size:11.5px; }
.mhp-sheet__head small{ display:block; color:var(--mh-ink-3); font-size:9px; margin-top:2px; }
.mhp-sheet h5{ margin:8px 0 2px; font:700 8.5px var(--mh-font-body); letter-spacing:.1em; text-transform:uppercase;
  color:var(--mh-ink-3); }
.mhp-sheet p{ color:var(--mh-ink-2); }
.mhp-sheet .mhp-sheet__exam{ display:flex; align-items:center; gap:6px; }
.mhp-sheet__foot{ border-top:1px solid var(--mh-hairline); margin-top:9px; padding-top:7px;
  font-size:8.5px; color:var(--mh-ink-3); font-style:italic; }
.mhp-export{ display:flex; align-items:center; justify-content:center; gap:6px; font-size:10.5px; font-weight:700;
  color:var(--mh-brand); }
.mhp-export svg{ width:12px; height:12px; }

/* ---------- Privacidade / consentimento ---------- */
.mhp-toggle{ width:40px; height:24px; border-radius:999px; background:var(--mh-hairline); position:relative; flex:none; }
.mhp-toggle::after{ content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:var(--mh-e1); }
.mhp-toggle--on{ background-image:var(--mh-gradient); }
.mhp-toggle--on::after{ left:auto; right:2px; }
.mhp-trustrow{ display:flex; align-items:center; gap:8px; font-size:11px; font-weight:600; }
.mhp-trustrow svg{ width:13px; height:13px; color:var(--mh-brand); flex:none; }
.mhp-danger{ color:var(--mh-alert); font-weight:700; font-size:12px; }

/* ---------- Fragmentos de tela (sem moldura) p/ cards de recursos ---------- */
.mh-screenfrag{ background:var(--mh-canvas); border:1px solid var(--mh-hairline); border-radius:var(--mh-r-card);
  box-shadow:var(--mh-e2); padding:14px; width:260px; max-width:100%;
  font-family:var(--mh-font-body); font-size:12.5px; line-height:1.45; color:var(--mh-ink); }

/* ---------- Flutuação sutil (hero) ---------- */
@media (prefers-reduced-motion:no-preference){
  .mh-float{ animation:mh-float 7s ease-in-out infinite; }
}
@keyframes mh-float{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-8px); } }

/* responsivo: telefones menores em telas estreitas */
@media (max-width:360px){ .mh-phone{ width:268px; border-radius:50px; } .mh-phone__screen{ border-radius:42px; } }

/* ---------- Mapa do corpo ---------- */
.mhp-bodywrap{ position:relative; display:flex; justify-content:center; padding:6px 0 2px; }
.mhp-bodywrap img{ height:268px; width:auto; }
.mhp-pin{ position:absolute; display:flex; align-items:center; gap:5px; }
.mhp-pin__dot{ width:11px; height:11px; border-radius:50%; border:2px solid #fff; box-shadow:var(--mh-e1); flex:none; }
.mhp-pin--ok .mhp-pin__dot{ background:var(--mh-ok); }
.mhp-pin--watch .mhp-pin__dot{ background:var(--mh-watch); }
.mhp-pin--action .mhp-pin__dot{ background:var(--mh-action); }
.mhp-pin__lbl{ font-size:8.5px; font-weight:700; background:var(--mh-surface); border:1px solid var(--mh-hairline);
  border-radius:999px; padding:2px 7px; box-shadow:var(--mh-e1); white-space:nowrap; }

/* ---------- Rotina (anel de meta + barras 14 dias) ---------- */
.mhp-ring{ width:92px; height:92px; border-radius:50%; flex:none;
  background:conic-gradient(var(--mh-brand) calc(var(--p)*1%), var(--mh-surface-sunken) 0);
  display:grid; place-items:center; }
.mhp-ring__in{ width:70px; height:70px; border-radius:50%; background:var(--mh-surface);
  display:grid; place-items:center; text-align:center; line-height:1.1; }
.mhp-ring__in b{ font-family:var(--mh-font-display); font-size:17px; display:block; }
.mhp-ring__in small{ font-size:8px; color:var(--mh-ink-3); font-weight:600; }
.mhp-stats{ display:flex; gap:14px; }
.mhp-stats div b{ font-family:var(--mh-font-display); font-size:14px; display:block; }
.mhp-stats div small{ font-size:8.5px; color:var(--mh-ink-3); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.mhp-bars{ display:flex; align-items:flex-end; gap:3px; height:44px; margin-top:8px; }
.mhp-bars span{ flex:1; background:var(--mh-brand-weak); border-radius:3px 3px 0 0; min-height:3px; }
.mhp-bars span.hi{ background:var(--mh-brand); }

/* ---------- Família (convite, somente leitura) ---------- */
.mhp-code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:15px; font-weight:700;
  letter-spacing:.14em; text-align:center; background:var(--mh-surface-sunken);
  border:1px dashed var(--mh-ink-3); border-radius:10px; padding:9px 6px; }
.mhp-lock{ display:inline-flex; align-items:center; gap:4px; font-size:8.5px; font-weight:700;
  color:var(--mh-ink-2); background:var(--mh-surface-sunken); border:1px solid var(--mh-hairline);
  border-radius:999px; padding:2px 7px; }
.mhp-lock svg{ width:9px; height:9px; }
.mhp-tagchip{ display:inline-flex; align-items:center; gap:4px; font-size:8.5px; font-weight:700;
  color:var(--mh-brand); background:var(--mh-brand-weak); border-radius:999px; padding:2px 7px; }
.mhp-avatar{ width:30px; height:30px; border-radius:50%; background:var(--mh-brand-weak); color:var(--mh-brand);
  display:grid; place-items:center; font-weight:700; font-size:11px; flex:none; }

/* ---------- Composição em leque: fotos editoriais + iPhone ---------- */
/* Um "leque" de fotos retrato emerge por trás do iPhone, como um baralho
   aberto. Cada carta usa --r (rotação), --x e --y (deslocamento) inline,
   pivotando pela base — o aparelho fica por cima (z-index alto). */
.mh-fan{ position:relative; display:inline-flex; justify-content:center;
  transform:translateX(var(--fan-shift,0)) scale(var(--fan-scale,1));
  transform-origin:50% 76%; }
/* o leque precisa de espaço simétrico nas duas pontas. As colunas do device
   colapsam na largura do aparelho e encostam na borda — então reposicionamos o
   leque inteiro (aparelho + cartas) para a folga central de cada seção. */
.mh-trend__device:has(.mh-fan){ justify-self:center; }
.mh-deep__media:has(.mh-fan){ justify-self:center; }
@media (min-width:1024px){
  .mh-deep__media .mh-fan{ --fan-shift:124px; } /* rotina: aparelho à esquerda → abre p/ a folga à direita */
  #tendencias .mh-fan{ --fan-shift:10px; }
}
/* faixa intermediária (notebooks): encolhe o leque para caber nas colunas menores */
@media (min-width:1024px) and (max-width:1380px){
  .mh-fan{ --fan-scale:.82; }
  .mh-deep__media .mh-fan{ --fan-shift:120px; }
  #tendencias .mh-fan{ --fan-shift:4px; }
}
@media (min-width:1024px) and (max-width:1140px){
  .mh-fan{ --fan-scale:.72; }
  .mh-deep__media .mh-fan{ --fan-shift:104px; }
  #tendencias .mh-fan{ --fan-shift:-22px; }
}
.mh-fan__card{
  position:absolute; left:50%; bottom:150px;
  width:212px; height:318px; object-fit:cover; box-sizing:border-box;
  background:#fff; padding:9px 9px 20px; /* moldura branca tipo polaroid */
  border-radius:18px; box-shadow:0 30px 60px -22px rgba(11,21,36,.5), 0 8px 20px -12px rgba(11,21,36,.3);
  transform-origin:50% 100%; /* pivô na base → tops abrem como um leque */
  transform:translateX(-50%)
    translate(calc(var(--x,0) * var(--fs,1)), calc(var(--y,0) * var(--fs,1)))
    rotate(var(--r,0deg));
  will-change:transform;
}
.mh-fan__card::after{ /* leve vinheta para dar profundidade às cartas de trás */
  content:""; position:absolute; inset:9px 9px 20px; border-radius:10px;
  box-shadow:inset 0 0 0 1px rgba(11,21,36,.06);
}
.mh-fan .mh-phone{ position:relative; z-index:4; }
@media (max-width:560px){
  /* encolhe o leque inteiro (aparelho + cartas) para caber, mantendo as fotos visíveis */
  .mh-fan{ --fan-scale:.71; --fan-shift:0; transform-origin:50% 88%; }
  .mh-fan__card{ width:172px; height:258px; bottom:118px; padding:7px 7px 16px; --fs:.6; }
  .mh-fan__card--crown{ --fs:.46; } /* aproxima o topo do aparelho menor */
}

/* Telas REAIS do app (capturas do simulador com dados de amostra, sem PII).
   Sobrepõem o mockup CSS dentro da moldura — mesma proporção 440/956. */
.mh-phone__screen .mh-shot{ position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:top center; z-index:7; display:block; border-radius:inherit;
  background:var(--mh-canvas); }

/* HERO: telefone "vivo" — alterna entre telas REAIS do app com crossfade (animado, 100% real). */
.mh-shot-cycle{ position:absolute; inset:0; z-index:7; border-radius:inherit; overflow:hidden; background:var(--mh-canvas); }
/* Crossfade ENCADEADO: com 3 telas e passos de 1/3 (delays 0/5/10s, loop 15s), a janela de
   FADE-OUT de cada tela coincide EXATAMENTE com o FADE-IN da próxima (inclusive no wrap 3→1),
   então nunca há quadro "vazio" — a troca é uma dissolução suave e contínua. */
.mh-shot-cycle img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  object-position:top center; opacity:0; animation:mhShotCycle 15s infinite linear; will-change:opacity; }
.mh-shot-cycle img:nth-child(1){ animation-delay:0s; }
.mh-shot-cycle img:nth-child(2){ animation-delay:5s; }
.mh-shot-cycle img:nth-child(3){ animation-delay:10s; }
@keyframes mhShotCycle{ 0%{opacity:0} 7%{opacity:1} 33.333%{opacity:1} 40.333%{opacity:0} 100%{opacity:0} }
@media (prefers-reduced-motion:reduce){
  .mh-shot-cycle img{ animation:none; opacity:0; }
  .mh-shot-cycle img:nth-child(1){ opacity:1; }
}

/* Relatório de Saúde exportável (1ª página real, paisagem) — exibido como documento. */
.mh-reportshot{ border-radius:14px; overflow:hidden; background:#fff;
  box-shadow:0 24px 60px rgba(11,21,36,.22), 0 2px 8px rgba(11,21,36,.10);
  border:1px solid rgba(11,21,36,.06); transform:rotate(-1.2deg); }
.mh-reportshot img{ width:100%; height:auto; display:block; }
@media (prefers-reduced-motion:reduce){ .mh-reportshot{ transform:none; } }
