.med-ad {
  container-type: inline-size;
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  margin-inline: auto;
  background: linear-gradient(112deg, #173058, #175777 55%, #075c58);
  color: #fff;
  font: 400 16px/1 Arial, sans-serif;
  text-align: left;
  text-decoration: none !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.med-ad:focus-visible { outline: 2px solid #08766d; outline-offset: 2px; }
.med-ad::after { content: ""; position: absolute; inset: 0; border: 1px solid #bdf9ed73; pointer-events: none; }
.med-faixa { max-width: 728px; aspect-ratio: 728 / 90; }
.med-cel { max-width: 320px; aspect-ratio: 320 / 100; }
.med-quadro { max-width: 300px; aspect-ratio: 300 / 250; }
.med-faixa > * { --u: calc(100cqw / 728); }
.med-cel > * { --u: calc(100cqw / 320); }
.med-quadro > * { --u: calc(100cqw / 300); }
.med-ad * { box-sizing: border-box; }

.med-agua {
  position: absolute;
  inset: -75% -28%;
  pointer-events: none;
  background: radial-gradient(ellipse at 70% 66%, #38c4ac8f, transparent 42%),
    radial-gradient(ellipse at 21% 47%, #577fce7a, transparent 42%);
  animation: med-corrente 10s ease-in-out infinite;
}

@keyframes med-corrente {
  0%, 100% { transform: translate(-6%, 2%) rotate(-5deg); }
  50% { transform: translate(12%, -7%) rotate(8deg); }
}

.med-rede { position: absolute; inset: 0; color: #c5fff3; pointer-events: none; opacity: .55; }
.med-no {
  position: absolute;
  left: var(--med-x);
  top: var(--med-y);
  width: 0;
  height: 0;
}

.med-no:nth-child(1) { --med-x: 3%; --med-y: 58%; --med-fase: -.8s; }
.med-no:nth-child(2) { --med-x: 25%; --med-y: 19%; --med-fase: -2.2s; }
.med-no:nth-child(3) { --med-x: 44%; --med-y: 88%; --med-fase: -1.3s; }
.med-no:nth-child(4) { --med-x: 63%; --med-y: 22%; --med-fase: -3.1s; }
.med-no:nth-child(5) { --med-x: 82%; --med-y: 83%; --med-fase: -1.7s; }
.med-no:nth-child(6) { --med-x: 97%; --med-y: 41%; --med-fase: -.3s; }

.med-ramo {
  position: absolute;
  width: calc(var(--med-l, 50) * var(--u));
  height: calc(1.15 * var(--u));
  transform: rotate(var(--med-giro));
  transform-origin: left center;
}

.med-ramo:nth-child(1) { --med-giro: -26deg; }
.med-ramo:nth-child(2) { --med-giro: 48deg; }
.med-ramo:nth-child(3) { --med-giro: 194deg; }
.med-no:nth-child(even) .med-ramo:nth-child(1) { --med-giro: -145deg; }
.med-no:nth-child(even) .med-ramo:nth-child(2) { --med-giro: 23deg; }
.med-no:nth-child(even) .med-ramo:nth-child(3) { --med-giro: 127deg; }
.med-ramo:nth-child(2) { --med-l: 40; }
.med-ramo:nth-child(3) { --med-l: 56; }
.med-faixa .med-ramo:nth-child(1) { --med-l: 78; }
.med-faixa .med-ramo:nth-child(2) { --med-l: 64; }
.med-faixa .med-ramo:nth-child(3) { --med-l: 91; }
.med-quadro .med-no:nth-child(1) { --med-x: 14%; --med-y: 22%; }
.med-quadro .med-no:nth-child(2) { --med-x: 79%; --med-y: 11%; }
.med-quadro .med-no:nth-child(3) { --med-x: 6%; --med-y: 58%; }
.med-quadro .med-no:nth-child(4) { --med-x: 86%; --med-y: 49%; }
.med-quadro .med-no:nth-child(5) { --med-x: 26%; --med-y: 86%; }
.med-quadro .med-no:nth-child(6) { --med-x: 86%; --med-y: 78%; }

.med-ramo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #b8fff18f, currentColor);
  opacity: .31;
  transform-origin: left;
  animation: med-conectar 4.2s var(--med-fase) ease-in-out infinite;
}

.med-ramo::after, .med-no::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: calc(5 * var(--u));
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 calc(7 * var(--u)) #a1ffef91;
  opacity: .63;
  transform: translate(-50%, -50%);
  animation: med-sinal 4.2s var(--med-fase) ease-in-out infinite;
}

.med-no::after { width: calc(7 * var(--u)); }
@keyframes med-conectar {
  0%, 100% { opacity: .16; transform: scaleX(.12); }
  47%, 67% { opacity: .65; transform: scaleX(1); }
}
@keyframes med-sinal {
  0%, 100% { opacity: .26; transform: translate(-50%, -50%) scale(.66); }
  53% { opacity: .96; transform: translate(-50%, -50%) scale(1.18); }
}

/* O traçado mantém a onda com a mesma proporção e estende as retas até as bordas. */
.med-ecg {
  position: absolute;
  inset: var(--med-ecg-top) 0 auto;
  display: grid;
  grid-template-columns: var(--med-ecg-inicio) calc(82 * var(--u)) 1fr;
  align-items: center;
  height: calc(38 * var(--u));
  pointer-events: none;
  color: #adfff0;
  opacity: .67;
  animation: med-batimento 5.2s -.35s ease-in-out infinite;
}

.med-ecg::before, .med-ecg::after { content: ""; height: calc(1.5 * var(--u)); background: currentColor; }
.med-onda {
  height: 100%;
  background: currentColor;
  clip-path: polygon(0 48%, 20% 48%, 27% 33%, 35% 48%, 42% 48%, 50% 4%,
    59% 84%, 66% 48%, 72% 48%, 79% 36%, 87% 48%, 100% 48%, 100% 52%,
    86% 52%, 79% 41%, 73% 52%, 67% 52%, 59% 96%, 50% 17%, 43% 52%,
    34% 52%, 27% 39%, 21% 52%, 0 52%);
}

@keyframes med-batimento {
  0% { clip-path: inset(0 100% 0 0); opacity: .25; }
  35%, 65% { clip-path: inset(0); opacity: .77; }
  100% { clip-path: inset(0); opacity: .25; }
}

.med-brilho {
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 39%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #61f6dc30 30%, #cafff97a 51%, #82f6e146 61%, transparent);
  animation: med-varrer 5.8s -1.65s ease-in-out infinite;
}

@keyframes med-varrer {
  0%, 22% { transform: translateX(0) skewX(-22deg); }
  60%, 100% { transform: translateX(460%) skewX(-22deg); }
}

.med-assinatura {
  position: absolute;
  isolation: isolate;
  width: calc(var(--med-logo-w) * var(--u));
}

.med-ad .med-logo { display: block; width: 100%; height: auto; max-width: none; margin: 0; }
.med-assinatura::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 26%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1;
  border: calc(1 * var(--u)) solid #d3fff7cb;
  border-radius: 50%;
  background: radial-gradient(circle, #c5fff369, transparent 66%);
  animation: med-halo 3.6s -.3s ease-out infinite;
}

@keyframes med-halo {
  0% { opacity: .83; transform: translate(-50%, -50%) scale(.8); }
  77%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

.med-conteudo { position: absolute; }
.med-mensagens { position: relative; display: block; height: calc(34 * var(--u)); }
.med-mensagem {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: calc(28 * var(--u));
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.027em;
  white-space: nowrap;
  opacity: 0;
  animation: med-mensagem 16s var(--med-fase, -.55s) ease-in-out infinite;
}

.med-mensagem:first-child { opacity: 1; }
.med-mensagem:nth-child(2) { --med-fase: -12.55s; }
.med-mensagem:nth-child(3) { --med-fase: -8.55s; }
.med-mensagem:nth-child(4) { --med-fase: -4.55s; }

@keyframes med-mensagem {
  0% { opacity: 0; transform: translateY(calc(5 * var(--u))); }
  3%, 22% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(calc(-4 * var(--u))); }
}

.med-local { display: block; margin-top: calc(3 * var(--u)); color: #d8fff9; font-size: calc(13 * var(--u)); line-height: 1.15; }
.med-cta {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(7 * var(--u));
  border: calc(1 * var(--u)) solid #e1fff7;
  border-radius: calc(24 * var(--u));
  background: linear-gradient(105deg, #d9fff5, #a5ebd9);
  color: #123f50;
  font-size: calc(13 * var(--u));
  font-weight: 700;
  white-space: nowrap;
  animation: med-pulso 2.4s ease-in-out infinite;
}

.med-ad:hover .med-cta, .med-ad:focus-visible .med-cta { background: #fff; }
.med-seta { font-size: 1.55em; line-height: .65; animation: med-seta 1.2s ease-in-out infinite; }

@keyframes med-pulso {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 #b1ffe900; }
  45% { transform: scale(1.055); box-shadow: 0 0 0 calc(4 * var(--u)) #b1ffe953; }
  75% { transform: scale(1.016); box-shadow: 0 0 0 calc(7 * var(--u)) #b1ffe90c; }
}

@keyframes med-seta { 50% { transform: translateX(.22em); } }

.med-faixa .med-ecg {
  --med-ecg-top: calc(52 * var(--u));
  --med-ecg-inicio: 62%;
  mask-image: linear-gradient(90deg, #0004 0 19%, #000 32%);
}
.med-faixa .med-assinatura { --med-logo-w: 94; left: calc(31 * var(--u)); top: calc(10 * var(--u)); }
.med-faixa .med-conteudo { inset: calc(16 * var(--u)) calc(206 * var(--u)) auto calc(155 * var(--u)); padding-left: calc(20 * var(--u)); border-left: 1px solid #bbf6e98c; }
.med-faixa .med-cta { right: calc(19 * var(--u)); top: calc(26 * var(--u)); width: calc(162 * var(--u)); height: calc(38 * var(--u)); }

.med-cel .med-ecg {
  --med-ecg-top: calc(47 * var(--u));
  --med-ecg-inicio: 23%;
  mask-image: linear-gradient(90deg, #0004 0 30%, #000 40%);
}
.med-cel .med-assinatura { --med-logo-w: 89; left: calc(15 * var(--u)); top: calc(15 * var(--u)); }
.med-cel .med-conteudo { top: calc(10 * var(--u)); left: calc(120 * var(--u)); right: calc(9 * var(--u)); }
.med-cel .med-mensagens { height: calc(29 * var(--u)); }
.med-cel .med-mensagem { font-size: calc(18 * var(--u)); }
.med-cel .med-local { margin-top: calc(1 * var(--u)); font-size: calc(11 * var(--u)); }
.med-cel .med-cta { left: calc(133 * var(--u)); right: calc(12 * var(--u)); bottom: calc(9 * var(--u)); height: calc(26 * var(--u)); font-size: calc(11 * var(--u)); }

.med-quadro .med-ecg { --med-ecg-top: calc(214 * var(--u)); --med-ecg-inicio: 6%; } /* Claude: rodapé, sem cruzar o logo */
.med-quadro .med-assinatura { --med-logo-w: 129; left: calc(85.5 * var(--u)); top: calc(15 * var(--u)); }
.med-quadro .med-conteudo { inset: calc(135 * var(--u)) calc(12 * var(--u)) auto; text-align: center; }
.med-quadro .med-mensagens { height: calc(34 * var(--u)); }
.med-quadro .med-mensagem { justify-content: center; font-size: calc(25 * var(--u)); }
.med-quadro .med-cta { inset: auto calc(45 * var(--u)) calc(17 * var(--u)); height: calc(38 * var(--u)); }

.med-ad.med-alt { display: none; }
@media (max-width: 700px) {
  .med-ad.med-pc { display: none; }
  .med-ad.med-alt { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .med-ad *, .med-ad *::before, .med-ad *::after { animation: none !important; }
  .med-brilho, .med-assinatura::before, .med-mensagem:not(:first-child) { display: none; }
  .med-ecg { opacity: .38; }
}

.cm-site a.med-ad, .cm-site a.med-ad:hover, .cm-site a.med-ad:focus { color: #fff; }
