/* Centered popup override v10.6.95
 * All supported screen sizes: desktop, tablet and phone.
 * One popup = exact viewport center.
 * If KYC + install are visible together, they form a centered vertical stack.
 */

:root{
  --gt-center-popup-gap:12px;
}

/* KYC reminder: centered on every device. */
.gt-kyc-alert.gt-kyc-popup-v10651{
  position:fixed!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  width:min(340px,calc(100vw - 24px))!important;
  max-width:340px!important;
  max-height:min(220px,calc(100dvh - 32px))!important;
  margin:0!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  transform:translate(-50%,calc(-50% + 14px))!important;
  transform-origin:center!important;
  z-index:10043!important;
}
.gt-kyc-alert.gt-kyc-popup-v10651.gt-kyc-popup-show{
  transform:translate(-50%,-50%)!important;
}

/* User/admin install mini-popup: centered on every device. */
.gt-mini-install,
.gt-mini-install.gt-admin-mini-install{
  position:fixed!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  width:min(300px,calc(100vw - 24px))!important;
  max-width:300px!important;
  margin:0!important;
  box-sizing:border-box!important;
  transform:translate(-50%,calc(-50% + 14px))!important;
  transform-origin:center!important;
  z-index:10044!important;
}
.gt-mini-install.is-open,
.gt-mini-install.gt-admin-mini-install.is-open{
  transform:translate(-50%,-50%)!important;
}

/* If both compact popups are ever visible together, keep the pair centered
   instead of letting them cover each other. */
body:has(.gt-kyc-alert.gt-kyc-popup-v10651.gt-kyc-popup-show):has(.gt-mini-install.is-open)
.gt-kyc-alert.gt-kyc-popup-v10651{
  top:calc(50% - 44px)!important;
}
body:has(.gt-kyc-alert.gt-kyc-popup-v10651.gt-kyc-popup-show):has(.gt-mini-install.is-open)
.gt-mini-install.is-open{
  top:calc(50% + 44px)!important;
}

/* Mandatory derivatives notice stays centered on every screen. */
.gt-risk-backdrop{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:16px!important;
}
.gt-risk-dialog{
  margin:auto!important;
  width:min(430px,calc(100vw - 32px))!important;
  max-height:calc(100dvh - 32px)!important;
}

/* Tablet: still centered, slightly narrower. */
@media(min-width:600px) and (max-width:1024px){
  .gt-kyc-alert.gt-kyc-popup-v10651{
    width:min(330px,calc(100vw - 32px))!important;
  }
  .gt-mini-install,
  .gt-mini-install.gt-admin-mini-install{
    width:min(294px,calc(100vw - 32px))!important;
  }
  .gt-risk-dialog{
    width:min(410px,calc(100vw - 40px))!important;
  }
}

/* Phone: compact but exactly centered and fully inside the viewport. */
@media(max-width:599px){
  .gt-kyc-alert.gt-kyc-popup-v10651{
    width:min(306px,calc(100vw - 20px))!important;
    max-height:calc(100dvh - 28px)!important;
  }
  .gt-mini-install,
  .gt-mini-install.gt-admin-mini-install{
    width:min(286px,calc(100vw - 20px))!important;
  }
  .gt-risk-backdrop{
    padding:10px!important;
  }
  .gt-risk-dialog{
    width:min(330px,calc(100vw - 20px))!important;
    max-height:calc(100dvh - 20px)!important;
  }

  body:has(.gt-kyc-alert.gt-kyc-popup-v10651.gt-kyc-popup-show):has(.gt-mini-install.is-open)
  .gt-kyc-alert.gt-kyc-popup-v10651{
    top:calc(50% - 42px)!important;
  }
  body:has(.gt-kyc-alert.gt-kyc-popup-v10651.gt-kyc-popup-show):has(.gt-mini-install.is-open)
  .gt-mini-install.is-open{
    top:calc(50% + 42px)!important;
  }
}

/* Very short screens: the popup itself can scroll, but its center is unchanged. */
@media(max-height:560px){
  .gt-kyc-alert.gt-kyc-popup-v10651{
    max-height:calc(100dvh - 20px)!important;
  }
  .gt-risk-dialog{
    max-height:calc(100dvh - 12px)!important;
  }
}
