/* Legal documents share a stable viewport; the application underneath never moves. */
.terms-popup-shell{
  position:fixed;
  inset:0;
  z-index:1000005;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(16,32,51,.38);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  outline:none;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease,visibility 0s linear .18s;
}
.terms-popup-shell.active{
  display:flex;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  animation:none;
  transition:opacity .18s ease,visibility 0s;
}
.terms-popup-window{
  position:relative;
  width:min(100%,920px);
  height:min(94vh,960px);
  height:min(94dvh,960px);
  overflow:hidden;
  border-radius:18px;
  background:#f4f7f9;
  border:1px solid rgba(16,32,51,.12);
  box-shadow:0 24px 70px rgba(10,25,36,.22);
  animation:none;
  transform:none;
}
.terms-popup-frame{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#f4f7f9;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .16s ease,visibility 0s linear .16s;
}
.terms-popup-frame.active{
  opacity:1;
  visibility:visible;
  pointer-events:none;
  transition:opacity .16s ease,visibility 0s;
}
.terms-popup-shell.active .terms-popup-frame.active{pointer-events:auto}
.terms-popup-loading{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#5c7080;
  font-size:14px;
  font-weight:700;
  background:#f4f7f9;
}
.terms-popup-loading[hidden]{display:none}
body.legal-popup-open .customer-side-menu,
body.legal-popup-open .customer-menu-overlay{transition:none!important}
.customer-menu-legal button{
  padding:3px 0;
  border:0;
  background:none;
  color:inherit;
  font:inherit;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.customer-menu-legal button:hover{color:var(--menu-primary)}
.customer-menu-legal button:focus-visible{outline:2px solid var(--menu-primary);outline-offset:3px;border-radius:2px}
@media(max-width:640px){
  .terms-popup-shell{padding:0}
  .terms-popup-window{width:100%;height:100vh;height:100dvh;border:0;border-radius:0;box-shadow:none}
}
@media(prefers-reduced-motion:reduce){
  .terms-popup-shell,.terms-popup-shell.active,.terms-popup-frame,.terms-popup-frame.active{animation:none;transition:none}
}

/* A document uses a compact wait/error card until its iframe is ready. */
body.customer-ui #termsPopupShell[data-state="loading"] .terms-popup-window,
body.customer-ui #termsPopupShell[data-state="error"] .terms-popup-window{
 width:min(100%,480px);height:auto;max-height:calc(var(--customer-dialog-viewport,100dvh) - 28px);padding:32px;overflow:auto;
}
body.customer-ui #termsPopupShell:not([data-state="ready"]) .terms-popup-frame{display:none!important}
body.customer-ui #termsPopupShell:not([data-state="ready"]) .terms-popup-loading{position:relative;inset:auto;background:transparent}
body.customer-ui #termsPopupShell .legal-loading-card{padding:0;min-width:0;border:0;box-shadow:none;background:transparent}
.legal-window-close{position:absolute;z-index:3;left:12px;top:8px;border:0;background:none;font:26px Arial;color:#888;cursor:pointer;width:32px;height:32px}
#termsPopupShell[data-state="ready"] .legal-window-close{display:none}
.legal-wait-actions{display:grid;gap:8px;margin-top:20px}.legal-wait-actions button{border:0;border-radius:5px;padding:12px;background:#4ba3ff;color:white;font:16px Arial;cursor:pointer}.legal-wait-actions button+button{background:transparent;color:#777}
