.fpm-modal-is-open {
  overflow: hidden;
}

.fpm-modal[hidden] {
  display: none;
}

.fpm-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.fpm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.68);
}

.fpm-modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  outline: none;
}

.fpm-modal__header {
  padding: 28px 32px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.fpm-modal__header h2 {
  margin: 0;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1.2;
}

.fpm-modal__header p {
  margin: 10px 0 0;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.5;
}

.fpm-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.fpm-modal__close:hover,
.fpm-modal__close:focus-visible {
  background: #e5e7eb;
}

.fpm-modal__notice {
  margin: 20px 32px 0;
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  line-height: 1.45;
}

.fpm-modal__preview {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 18px 32px 4px;
}

.fpm-modal__row {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #eef2f7;
}

.fpm-modal__row dt {
  margin: 0;
  color: #374151;
  font-weight: 700;
}

.fpm-modal__row dd {
  margin: 0;
  color: #111827;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.fpm-modal__empty {
  padding: 18px 0;
  color: #4b5563;
}

.fpm-modal__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 32px 28px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.fpm-modal__button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.fpm-modal__button--secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.fpm-modal__button--primary {
  background: #0f766e;
  color: #fff;
}

.fpm-modal__button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.fpm-modal__button:focus-visible,
.fpm-modal__close:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .fpm-modal {
    padding: 12px;
  }

  .fpm-modal__panel {
    max-height: calc(100vh - 24px);
  }

  .fpm-modal__header,
  .fpm-modal__preview,
  .fpm-modal__actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .fpm-modal__notice {
    margin-left: 18px;
    margin-right: 18px;
  }

  .fpm-modal__row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .fpm-modal__actions {
    display: grid;
  }
}
