html.nwkl-modal-open,
body.nwkl-modal-open { overflow: hidden; }

.nwkl-gf-customizer .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: var(--space-l);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: nwkl-gf-fade-in 0.18s ease-out;
}

.nwkl-gf-customizer .modal-backdrop.open { display: flex; margin-block-start: 0; }

.nwkl-gf-customizer .modal {
  background: var(--Surface-Background);
  border-radius: var(--radius-4xl);
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: nwkl-gf-slide-up 0.22s ease-out;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  height: auto;
}

.nwkl-gf-customizer .modal-close {
  width: 44px;
  height: 44px;
  border: none;
  background: #f5f5f5;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  color: #4a4a4a;
  position: absolute;
  right: 32px;
  top: 20px;
  font-size: 24px;
  z-index: 9;
}

.nwkl-gf-customizer .modal-close:hover { background: #e0e0e0; color: #1b1b1f; }
.nwkl-gf-customizer .modal-close:focus-visible {
  outline: var(--line-width-focus) solid var(--Controls-Focus-Ring);
  outline-offset: 2px;
}
.nwkl-gf-customizer .modal-close svg {
  width: 18px;
  min-width: 18px;
}
.nwkl-gf-customizer .modal-close .icon { width: 18px; height: 18px; }

.nwkl-gf-customizer .nwkl-gf-mount {
  width: 100%;
}

.nwkl-gf-customizer .nwkl-modal-status {
  display: flex;
  min-height: 320px;
  padding: 80px var(--space-2xl) var(--space-2xl);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-md);
  background: var(--Surface-Background);
  color: var(--Text-Secondary);
  text-align: center;
}

.nwkl-gf-customizer .nwkl-modal-status[hidden],
.nwkl-gf-customizer .nwkl-gf-mount[hidden] {
  display: none;
}

.nwkl-gf-customizer .nwkl-modal-status p {
  max-width: 36ch;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 24px;
}

.nwkl-gf-customizer .nwkl-modal-status-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--Surface-Border);
  border-top-color: var(--Controls-Default);
  border-radius: var(--radius-full);
  animation: nwkl-gf-shell-spin 0.7s linear infinite;
}

.nwkl-gf-customizer .nwkl-gf-retry {
  min-height: 44px;
  padding: 0 var(--space-l);
  border: none;
  border-radius: var(--radius-xl);
  background: var(--Controls-Default);
  color: var(--White);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
}

.nwkl-gf-customizer .nwkl-gf-retry:hover {
  background: var(--Controls-Default-Hover);
}

.nwkl-gf-customizer .nwkl-gf-retry:focus-visible {
  outline: var(--line-width-focus) solid var(--Controls-Focus-Ring);
  outline-offset: 2px;
}

@keyframes nwkl-gf-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nwkl-gf-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nwkl-gf-shell-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .nwkl-gf-customizer .modal-backdrop { padding: 0; align-items: stretch; }
  .nwkl-gf-customizer .modal {
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    animation: nwkl-gf-slide-up-mobile 0.25s ease-out;
  }
  .nwkl-gf-customizer .modal-close { right: 20px; }
  .nwkl-gf-customizer .nwkl-modal-status { min-height: 100dvh; padding-inline: var(--space-l); }
}

@keyframes nwkl-gf-slide-up-mobile { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .nwkl-gf-customizer .modal-backdrop,
  .nwkl-gf-customizer .modal {
    animation: none;
  }
  .nwkl-gf-customizer .nwkl-modal-status-spinner {
    animation: none;
  }
}
