.cl-iframe-modal-shell:not([hidden]) {
  display: flex !important;
}

.cl-iframe-modal-shell {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cl-iframe-modal-shell__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cl-iframe-modal-shell__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  height: 80vh;
  max-height: min(80vh, calc(100dvh - 32px));
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  flex-shrink: 1;
}

.cl-iframe-modal-shell--login {
  padding: 12px !important;
  align-items: center !important;
  justify-content: center !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cl-iframe-modal-shell--login .cl-iframe-modal-shell__panel {
  width: min(calc(100vw - 24px), 800px);
  height: auto;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  flex: 0 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cl-iframe-modal-shell--login .cl-iframe-modal-shell__body {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cl-iframe-modal-shell--login .cl-iframe-modal-shell__body iframe {
  width: 100% !important;
  min-height: 320px;
  max-height: calc(100dvh - 24px);
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  display: block !important;
  flex: 1 1 auto;
  min-height: 0;
  vertical-align: top;
  overflow: auto;
}

.cl-iframe-modal-shell__close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 5;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cl-iframe-modal-shell__body {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .cl-iframe-modal-shell {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  .cl-iframe-modal-shell__panel {
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .cl-iframe-modal-shell--login .cl-iframe-modal-shell__panel {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
  }

  .cl-iframe-modal-shell--login .cl-iframe-modal-shell__body,
  .cl-iframe-modal-shell--login .cl-iframe-modal-shell__body iframe {
    flex: 0 0 auto !important;
    max-height: 100dvh !important;
    min-height: 280px !important;
  }

  .cl-iframe-modal-shell__close {
    top: 12px;
    right: 16px;
  }
}
