.msdm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 15, 13, 0.68);
  backdrop-filter: blur(2px);
}

.msdm-dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-sizing: border-box;
  padding: 36px 34px 30px;
  border: 1px solid #d7d1c4;
  border-radius: 12px;
  background: #fffdf7;
  color: #1e1d19;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.msdm-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #323129;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.msdm-close:hover,
.msdm-close:focus-visible {
  background: #eee9dc;
  outline: 2px solid #1f6f43;
  outline-offset: 2px;
}

.msdm-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 20px;
  border: 4px solid #dce6de;
  border-top-color: #1f7a45;
  border-radius: 50%;
  animation: msdm-spin 0.85s linear infinite;
}

.msdm-started .msdm-spinner {
  border: 0;
  animation: none;
}

.msdm-started .msdm-spinner::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1f7a45;
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
}

.msdm-dialog h2 {
  margin: 0 30px 12px;
  color: #161510;
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.15;
}

.msdm-info {
  margin: 0 0 8px;
  color: #2d2b25;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
}

.msdm-file-note,
.msdm-status,
.msdm-retry-limit {
  margin: 8px auto;
  max-width: 440px;
  color: #5e5a50;
  font-size: 16px;
  line-height: 1.55;
}

.msdm-status {
  min-height: 25px;
  margin-top: 18px;
}

.msdm-retry-limit {
  margin-top: 18px;
  font-weight: 700;
}

.msdm-retry,
.msdm-return {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 13px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.msdm-retry[hidden],
.msdm-retry-limit[hidden] {
  display: none;
}

.msdm-retry {
  border: 2px solid #1f7a45;
  background: #1f7a45;
  color: #ffffff;
}

.msdm-retry:hover,
.msdm-retry:focus-visible {
  border-color: #155d33;
  background: #155d33;
  color: #ffffff;
}

.msdm-return {
  border: 1px solid #bdb7aa;
  background: transparent;
  color: #302e28;
}

.msdm-return:hover,
.msdm-return:focus-visible {
  background: #eee9dc;
}

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

@media (max-width: 600px) {
  .msdm-overlay {
    align-items: end;
    padding: 10px;
  }

  .msdm-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 34px 22px 24px;
    border-radius: 14px 14px 8px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msdm-spinner {
    animation-duration: 1.8s;
  }
}
