.agentostudio-ad,
.agentostudio-update-notice {
  box-sizing: border-box;
  color: #071b45;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
  position: fixed;
  z-index: 2147483000;
}

.agentostudio-ad *,
.agentostudio-update-notice * { box-sizing: border-box; }

.agentostudio-ad--banner {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: min(720px, calc(100vw - 24px));
  transform: translateX(-50%);
  width: 100%;
}

.agentostudio-ad--interstitial {
  align-items: center;
  background: rgba(2, 12, 35, .72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
}

.agentostudio-ad-card {
  align-items: center;
  background: #fff;
  border: 1px solid #cfe0ff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(5, 30, 80, .24);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) auto;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 12px 48px 12px 12px;
  position: relative;
  width: 100%;
}

.agentostudio-ad--interstitial .agentostudio-ad-card {
  grid-template-columns: 1fr;
  max-width: 620px;
  padding: 16px;
}

.agentostudio-ad-media {
  align-items: center;
  background: #edf4ff;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  min-height: 82px;
  overflow: hidden;
  position: relative;
}

.agentostudio-ad--interstitial .agentostudio-ad-media { min-height: 180px; }

.agentostudio-ad-media img,
.agentostudio-ad-media video {
  display: block;
  height: 100%;
  max-height: 52vh;
  object-fit: contain;
  width: 100%;
}

.agentostudio-ad-media-error::after {
  color: #49617f;
  content: "Mídia indisponível";
  font-size: 13px;
  padding: 22px;
}

.agentostudio-ad-media-error img,
.agentostudio-ad-media-error video { display: none; }

.agentostudio-ad-copy { min-width: 0; }
.agentostudio-ad-copy strong { color: #071b45 !important; display: block; font-size: 16px; margin-top: 4px; }
.agentostudio-ad-copy p { color: #405778 !important; font-size: 13px; margin: 5px 0 0; opacity: 1 !important; }
.agentostudio-ad-badge { color: #075eff !important; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.agentostudio-ad-countdown {
  background: #071b45;
  border-radius: 999px;
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
  left: 10px;
  padding: 6px 9px;
  position: absolute;
  top: 10px;
  z-index: 3;
}

.agentostudio-ad-sound {
  background: rgba(7, 27, 69, .92);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  bottom: 12px;
  color: #fff !important;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  left: 50%;
  min-height: 38px;
  padding: 8px 14px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 4;
}

.agentostudio-ad-sound[hidden] { display: none; }

.agentostudio-ad-action,
.agentostudio-update-notice > button:not(.agentostudio-update-close) {
  background: #075eff;
  border: 0;
  border-radius: 10px;
  color: #fff !important;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 16px;
}

.agentostudio-ad-close,
.agentostudio-update-close {
  align-items: center;
  background: #edf3fb;
  border: 0;
  border-radius: 50%;
  color: #071b45 !important;
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
}

.agentostudio-update-notice {
  align-items: center;
  background: #fff;
  border: 1px solid #bdd4ff;
  border-left: 5px solid #075eff;
  border-radius: 14px;
  bottom: max(12px, env(safe-area-inset-bottom));
  box-shadow: 0 18px 48px rgba(5, 30, 80, .24);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  left: 50%;
  max-width: min(720px, calc(100vw - 24px));
  padding: 14px 52px 14px 16px;
  transform: translateX(-50%);
  width: 100%;
}

.agentostudio-update-notice span { color: #075eff !important; display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agentostudio-update-notice strong { color: #071b45 !important; display: block; font-size: 16px; margin: 3px 0; }
.agentostudio-update-notice p { color: #405778 !important; font-size: 12px; margin: 0; opacity: 1 !important; }

@media (max-width: 620px) {
  .agentostudio-ad-card,
  .agentostudio-update-notice { grid-template-columns: 1fr; }
  .agentostudio-ad--banner .agentostudio-ad-media { display: none; }
  .agentostudio-ad-action,
  .agentostudio-update-notice > button:not(.agentostudio-update-close) { width: 100%; }
}

@media (orientation: landscape) and (max-height: 620px) {
  .agentostudio-ad--interstitial { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .agentostudio-ad--interstitial .agentostudio-ad-card {
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr);
    grid-template-rows: 1fr auto;
    max-height: calc(100dvh - 16px);
    max-width: min(960px, calc(100vw - 24px));
    overflow: auto;
  }
  .agentostudio-ad--interstitial .agentostudio-ad-media {
    grid-row: 1 / span 2;
    min-height: min(70dvh, 360px);
  }
  .agentostudio-ad--interstitial .agentostudio-ad-media img,
  .agentostudio-ad--interstitial .agentostudio-ad-media video { max-height: calc(100dvh - 48px); }
  .agentostudio-ad--interstitial .agentostudio-ad-action { align-self: end; width: 100%; }
  .agentostudio-ad--banner { max-width: min(900px, calc(100vw - 24px)); }
  .agentostudio-ad--banner .agentostudio-ad-card { max-height: min(46dvh, 220px); }
}

@media (prefers-reduced-motion: no-preference) {
  .agentostudio-ad-card,
  .agentostudio-update-notice { animation: agentostudio-enter .22s ease-out; }
  @keyframes agentostudio-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
