.mgbia-embed-widget {
  --mgbia-primary: #2563eb;
  --mgbia-height: 720px;
  --mgbia-panel-width: min(440px, calc(100vw - 24px));
  --mgbia-launcher-size: 86px;
  --mgbia-offset-x: 20px;
  --mgbia-offset-y: 20px;
  --mgbia-mobile-height: 88vh;
  --mgbia-mobile-launcher-size: 64px;
  --mgbia-mobile-offset-x: 12px;
  --mgbia-mobile-offset-y: 12px;
  --mgbia-mobile-z-index: 2147483647;
  position: fixed;
  right: var(--mgbia-offset-x);
  bottom: var(--mgbia-offset-y);
  z-index: 9999;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.mgbia-embed-widget-bottom-left,
.mgbia-embed-widget-top-left {
  left: var(--mgbia-offset-x);
  right: auto;
}

.mgbia-embed-widget-top-left,
.mgbia-embed-widget-top-right {
  top: var(--mgbia-offset-y);
  bottom: auto;
}

.mgbia-embed-launcher {
  position: relative;
  display: block;
  width: var(--mgbia-launcher-size);
  height: var(--mgbia-launcher-size);
  min-width: var(--mgbia-launcher-size);
  max-width: var(--mgbia-launcher-size);
  min-height: var(--mgbia-launcher-size);
  max-height: var(--mgbia-launcher-size);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
  text-align: center;
  flex: 0 0 var(--mgbia-launcher-size);
  padding: 0;
  border: 0;
  border-radius: 42% 58% 63% 37% / 38% 34% 66% 62% !important;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 76% 82%, rgba(148, 163, 184, 0.42) 0%, rgba(148, 163, 184, 0) 42%),
    linear-gradient(135deg, #dfe7ef 0%, #b9c4cf 26%, #f7fafc 44%, #9aa6b5 68%, #d4dce6 100%);
  box-shadow:
    0 24px 42px rgba(15, 23, 42, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 10px 16px rgba(255, 255, 255, 0.36) inset,
    0 -10px 16px rgba(100, 116, 139, 0.26) inset;
  cursor: pointer;
  overflow: visible;
  isolation: isolate;
  transform: rotate(-5deg);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease, box-shadow 220ms ease, filter 220ms ease;
  animation: mgbia-launcher-liquid 6s ease-in-out infinite;
}

.mgbia-embed-launcher::before,
.mgbia-embed-launcher::after {
  content: "";
  position: absolute;
  pointer-events: none;
  mix-blend-mode: screen;
}

.mgbia-embed-launcher::before {
  inset: -10px;
  border-radius: 48% 52% 58% 42% / 42% 36% 64% 58%;
  background:
    radial-gradient(64% 62% at 28% 26%, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(70% 64% at 72% 70%, rgba(148, 163, 184, 0.46) 0%, rgba(148, 163, 184, 0) 72%);
  filter: blur(6px);
  opacity: 0.76;
  z-index: -1;
  transform: scale(0.95);
  animation: mgbia-launcher-chrome-halo 3.8s ease-in-out infinite;
}

.mgbia-embed-launcher::after {
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.14) 28%,
      rgba(255, 255, 255, 0.02) 42%,
      rgba(255, 255, 255, 0.26) 58%,
      rgba(255, 255, 255, 0.08) 82%,
      rgba(255, 255, 255, 0) 100%
    );
  opacity: 0.52;
  z-index: 2;
  animation: mgbia-launcher-sheen 2.8s linear infinite;
}

.mgbia-embed-launcher:hover {
  transform: rotate(-2deg) translateY(-3px) scale(1.05);
  filter: saturate(1.08) brightness(1.04);
  box-shadow:
    0 30px 54px rgba(15, 23, 42, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.86) inset,
    0 12px 18px rgba(255, 255, 255, 0.42) inset,
    0 -12px 18px rgba(100, 116, 139, 0.28) inset;
}

.mgbia-embed-launcher:active {
  transform: rotate(-5deg) translateY(1px) scale(0.98);
}

.mgbia-embed-launcher:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 0 8px rgba(56, 189, 248, 0.68),
    0 24px 52px rgba(2, 6, 23, 0.48);
}

.mgbia-embed-launcher[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.88) rotate(-12deg);
  animation-play-state: paused;
}

.mgbia-embed-launcher[aria-expanded="true"]::before,
.mgbia-embed-launcher[aria-expanded="true"]::after {
  animation-play-state: paused;
  opacity: 0;
}

.mgbia-embed-launcher-dot {
  position: absolute;
  inset: 21px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.18),
    0 0 0 11px rgba(255, 255, 255, 0.09);
  z-index: 1;
}

.mgbia-embed-launcher-image {
  position: absolute;
  inset: 9px;
  border-radius: 44% 56% 58% 42% / 40% 38% 62% 60% !important;
  background-color: #ffffff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.18),
    0 0 0 12px rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(2, 6, 23, 0.26);
  z-index: 1;
}

.mgbia-embed-launcher:hover .mgbia-embed-launcher-image {
  filter: none;
}

@keyframes mgbia-launcher-liquid {
  0% {
    border-radius: 42% 58% 63% 37% / 38% 34% 66% 62%;
    transform: rotate(-5deg);
  }

  50% {
    border-radius: 58% 42% 36% 64% / 52% 60% 40% 48%;
    transform: rotate(4deg);
  }

  100% {
    border-radius: 42% 58% 63% 37% / 38% 34% 66% 62%;
    transform: rotate(-5deg);
  }
}

@keyframes mgbia-launcher-chrome-halo {
  0% {
    opacity: 0.66;
    transform: scale(0.94) rotate(0deg);
  }

  50% {
    opacity: 0.92;
    transform: scale(1.08) rotate(14deg);
  }

  100% {
    opacity: 0.66;
    transform: scale(0.94) rotate(0deg);
  }
}

@keyframes mgbia-launcher-sheen {
  0% {
    transform: translateX(-42%);
  }

  100% {
    transform: translateX(42%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mgbia-embed-launcher,
  .mgbia-embed-launcher::before,
  .mgbia-embed-launcher::after {
    animation: none !important;
  }
}

.mgbia-embed-panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--mgbia-launcher-size) + 18px);
  width: var(--mgbia-panel-width);
  height: min(var(--mgbia-height), calc(100vh - 120px));
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26);
}

.mgbia-embed-widget-bottom-left .mgbia-embed-panel,
.mgbia-embed-widget-top-left .mgbia-embed-panel {
  left: 0;
  right: auto;
}

.mgbia-embed-widget-top-left .mgbia-embed-panel,
.mgbia-embed-widget-top-right .mgbia-embed-panel {
  top: calc(var(--mgbia-launcher-size) + 18px);
  bottom: auto;
}

.mgbia-embed-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.86) 100%) !important;
  color: rgba(15, 23, 42, 0.72) !important;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transition: color 160ms ease, transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mgbia-embed-close:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.92) 100%);
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.mgbia-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

html.mgbia-no-scroll,
body.mgbia-no-scroll {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .mgbia-embed-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: var(--mgbia-mobile-z-index) !important;
    isolation: isolate;
    right: var(--mgbia-mobile-offset-x);
    left: var(--mgbia-mobile-offset-x);
    bottom: calc(var(--mgbia-mobile-offset-y) + env(safe-area-inset-bottom));
    --mgbia-panel-width: auto;
    --mgbia-launcher-size: var(--mgbia-mobile-launcher-size);
  }

  .mgbia-embed-launcher {
    margin: 0;
    z-index: var(--mgbia-mobile-z-index);
  }

  .mgbia-embed-widget.mgbia-mobile-pos-right .mgbia-embed-launcher {
    margin: 0;
  }

  .mgbia-embed-panel {
    left: 0;
    right: 0;
    width: auto;
    height: min(var(--mgbia-mobile-height), calc(100vh - 24px));
    height: min(var(--mgbia-mobile-height), calc(100dvh - 24px));
    bottom: 0;
    top: auto;
    border-radius: 18px;
    z-index: calc(var(--mgbia-mobile-z-index) + 1);
  }

  .mgbia-embed-launcher[aria-expanded="true"] {
    display: none;
  }

  .mgbia-embed-widget.mgbia-mobile-pos-left .mgbia-embed-launcher {
    margin: 0;
  }

  .mgbia-embed-widget.mgbia-mobile-pos-center .mgbia-embed-launcher {
    margin: 0;
  }

  .mgbia-embed-widget.mgbia-mobile-pos-left {
    align-items: flex-start;
  }

  .mgbia-embed-widget.mgbia-mobile-pos-center {
    align-items: center;
  }

  .mgbia-embed-widget.mgbia-mobile-mode-fullscreen .mgbia-embed-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .mgbia-embed-widget.mgbia-mobile-mode-fullscreen .mgbia-embed-close {
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
  }
}
