html.app-dialog-open,
body.app-dialog-open,
html.app-loading-open,
body.app-loading-open {
  overflow: hidden;
}

.app-dialog-backdrop.app-loading-backdrop {
  z-index: 19000;
  animation: none;
}

.app-dialog.app-loading-card {
  min-height: 0;
  gap: 24px;
  animation: none;
}

.app-loading-spinner {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 3px solid rgba(174, 180, 255, .2);
  border-top-color: #aeb4ff;
  border-radius: 50%;
  animation: app-loading-spin .8s linear infinite;
}

@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-spinner { animation: none; }
}

.app-dialog-backdrop {
  position: fixed;
  z-index: 20000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: app-dialog-backdrop-in .2s ease-out both;
}

.app-dialog-backdrop.is-closing {
  pointer-events: none;
  animation: app-dialog-backdrop-out .16s ease-in both;
}

.app-dialog {
  position: relative;
  display: flex;
  width: min(420px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  min-height: 244px;
  padding: 32px;
  box-sizing: border-box;
  align-items: center;
  flex-direction: column;
  color: #f5f8ff;
  background: #1d1d1f;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  font-family: Geist, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  animation: app-dialog-in .22s cubic-bezier(.2, .8, .2, 1) both;
}

.app-dialog-backdrop.is-closing .app-dialog {
  animation: app-dialog-out .16s ease-in both;
}

.app-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #9fa6b2;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font: 300 24px/1 Geist, sans-serif;
}

.app-dialog__close:hover {
  color: #f5f8ff;
  background: rgba(255, 255, 255, .08);
}

.app-dialog__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  color: #aeb4ff;
  background: rgba(124, 131, 255, .12);
  border: 1px solid rgba(174, 180, 255, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(124, 131, 255, .06);
}

.app-dialog--warning .app-dialog__icon {
  color: #f6c66f;
  background: rgba(245, 158, 11, .12);
  border-color: rgba(246, 198, 111, .22);
  box-shadow: 0 0 0 6px rgba(245, 158, 11, .06);
}

.app-dialog--danger .app-dialog__icon {
  color: #ff8b8b;
  background: rgba(255, 92, 92, .12);
  border-color: rgba(255, 139, 139, .22);
  box-shadow: 0 0 0 6px rgba(255, 92, 92, .06);
}

.app-dialog__icon svg {
  width: 28px;
  height: 28px;
}

.app-dialog__icon path {
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.app-dialog h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: #f5f8ff;
  font: 600 20px/26px Geist, sans-serif;
}

.app-dialog__message {
  max-width: 100%;
  margin: 12px 0 24px;
  overflow-wrap: anywhere;
  color: #b4b6ba;
  font: 400 14px/21px Geist, "Noto Sans SC", sans-serif;
  white-space: pre-wrap;
}

.app-dialog__form {
  display: flex;
  width: 100%;
  margin-top: auto;
  flex-direction: column;
  gap: 18px;
}

.app-dialog__input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  box-sizing: border-box;
  color: #f5f8ff;
  background: #111113;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  outline: none;
  font: 400 14px/20px Geist, "Noto Sans SC", sans-serif;
}

.app-dialog__input:focus {
  border-color: #9ca3ff;
  box-shadow: 0 0 0 3px rgba(156, 163, 255, .12);
}

.app-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.app-dialog__button {
  min-width: 0;
  min-height: 38px;
  height: auto;
  max-width: 100%;
  flex: 1 1 140px;
  padding: 9px 16px;
  overflow-wrap: anywhere;
  white-space: normal;
  border-radius: 19px;
  cursor: pointer;
  font: 500 14px/20px Geist, "Noto Sans SC", sans-serif;
}

.app-dialog__button--primary {
  color: #191919;
  background: #f5f8ff;
  border: 0;
}

.app-dialog__button--primary:hover { background: #fff; }

.app-dialog__button--secondary {
  color: #d4d5da;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16);
}

.app-dialog__button--secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.app-dialog__button:focus-visible,
.app-dialog__close:focus-visible {
  outline: 2px solid #9ca3ff;
  outline-offset: 2px;
}

@keyframes app-dialog-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-dialog-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes app-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes app-dialog-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(.985); }
}

@media (max-width: 520px) {
  .app-dialog-backdrop { padding: 16px; }
  .app-dialog { min-height: 0; max-height: calc(100dvh - 32px); padding: 28px 22px 24px; }
  .app-dialog__actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .app-dialog-backdrop,
  .app-dialog-backdrop.is-closing,
  .app-dialog,
  .app-dialog-backdrop.is-closing .app-dialog {
    animation-duration: 1ms;
  }
}
