div.psdm-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 199999; /* Sit on top */
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%; /* Full width */
  overflow: auto; /* Enable scroll if needed */
  overscroll-behavior: contain;
  background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
}

.psdm-inline-block {
  display: inline-flex;
  width: 100%;
  align-self: center;
}

.psdm-inline-edit {
  width: 100%;
  align-self: center;
  padding-right: 10px;
}

.psdm-inline-right {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}



.psdm-inline {
  width: 100%; /* Full width */
  height: 100%; /* Full height */
}


/* Modal Content/Box */
.psdm-modal-content {
  background-color: #fefefe;
  font-size: medium;
  margin: clamp(1rem, 12vh, 8rem) auto;
  padding: 5px 25px 10px;
  border: 2px solid #000000;
  border-radius: 10px;
  box-sizing: border-box;
  width: min(40rem, calc(100% - 2rem));
  max-width: 100%;
}

.psdm-inline-email {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: right;
 }

.psdm-modal-title {
  font-family: sans-serif;
  font-weight: bold;
  font-size: large;
}

.psdm-modal-body {
  font-family: sans-serif;
}

/* The Close Button */
.psdm-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.psdm-close:hover,
.psdm-close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.psdm-title {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
  font-weight: bold;
  font-size: 2em;
}

.psdm-padding-text {
  margin-bottom: 0.5em;
}

input[type="email"].psdm-input,
input[type="text"].psdm-input {
  width: 100%;
  padding: 6px 20px;
  line-height: 30px;
  margin: 4px 0;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid gray;
}

p.psdm_dialog_p {
  margin-bottom: 0.5em;
}

input[type="email"].psdm-inline-input,
input[type="text"].psdm-inline-input {
  width: 100%;
  padding: 6px 20px;
  line-height: 30px;
  margin: 4px 0;
  text-indent: 10px;
  box-sizing: border-box;
  border-radius: 3px;
  border: 1px solid gray;
}


button.psdm-button {
  background: mediumblue;
  border: none;color: white;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}

button.psdm-button:focus {
  opacity: 0.5;
}

button.psdm-button-download {
  width: 100%;
  font-size: medium;
}

button.psdm-inline-button-download {
  font-size: medium;
  width: 100%;
}

button.psdm-button:hover {
  opacity: 0.75;
}

@media (max-width: 767px) {
  .psdm-modal-content {
    margin-top: max(1rem, env(safe-area-inset-top));
    margin-bottom: max(1rem, env(safe-area-inset-bottom));
    padding: 16px 20px 20px;
    width: calc(100% - 2rem);
  }

  .psdm-title {
    font-size: 1.5em;
    padding-right: 1.25em;
  }

  .psdm-close {
    font-size: 32px;
    line-height: 0.9;
  }
}

@media (max-width: 479px) {
  .psdm-modal-content {
    width: calc(100% - 1rem);
    padding: 14px 16px 16px;
  }

  input[type="email"].psdm-input,
  input[type="text"].psdm-input {
    padding: 6px 12px;
  }

  button.psdm-button {
    min-height: 44px;
  }
}



.blocker {
  z-index: 2000;
}

.modal {
  z-index: 2001;
}

.psdm_error {
  color: red;
  font-weight: bold;
}

.psdm_no_visual {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

/* Modern Template Styles */
.psdm-modern-template {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 0;
  overflow: hidden;
  max-width: 40rem;
}

.psdm-modern-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px 30px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.psdm-modern-title {
  color: white;
  margin: 0;
  font-size: 1.75em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.psdm-modern-close {
  color: white;
  background: transparent;
  border: 0;
  float: none;
  font-size: 32px;
  line-height: 1;
  opacity: 0.8;
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.psdm-modern-close:hover,
.psdm-modern-close:focus {
  opacity: 1;
  color: white;
}

.psdm-modern-body {
  padding: 30px;
}

.psdm-modern-description {
  margin-bottom: 24px;
  color: #4a5568;
  line-height: 1.6;
}

.psdm-modern-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.psdm-modern-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.psdm-modern-field .psdm_error:empty {
  display: none;
}

.psdm-modern-input {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
}

.psdm-modern-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.psdm-modern-button {
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.psdm-modern-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.psdm-modern-actions {
  margin-top: 8px;
}

.psdm-modern-actions .psdm-modern-button {
  width: 100%;
}

@media (max-width: 767px) {
  .psdm-modern-header {
    padding: 20px;
  }

  .psdm-modern-body {
    padding: 24px 20px;
  }

  .psdm-modern-title {
    font-size: 1.5em;
    padding-right: 0;
  }
}

@media (max-width: 479px) {
  .psdm-modern-header {
    padding: 16px;
    gap: 12px;
  }

  .psdm-modern-body {
    padding: 20px 16px;
  }

  .psdm-modern-title {
    font-size: 1.25em;
    padding-right: 0;
  }

  .psdm-modern-form {
    gap: 12px;
  }

  .psdm-modern-input {
    padding: 12px;
  }
}

/* Minimal Template Styles */
.psdm-minimal-template {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 32px;
  max-width: 30rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
}

.psdm-minimal-close {
  color: #9ca3af;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 16px;
  top: 16px;
  transition: color 0.2s;
}

.psdm-minimal-close:hover,
.psdm-minimal-close:focus {
  color: #374151;
}

.psdm-minimal-header {
  margin-bottom: 20px;
  padding-right: 24px;
  font-size: 1.375em;
  color: #111827;
  font-weight: 900;
}

.psdm-minimal-title {
  font-size: 1.375em;
  margin: 0 0 8px;
  color: #111827;
  font-weight: 900;
}

.psdm-minimal-description {
  color: #6b7280;
  font-weight: 500;
  font-size: medium;
}

.psdm-minimal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.psdm-minimal-field,
.psdm-minimal-permission,
.psdm-minimal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.psdm-minimal-field .psdm_error:empty,
.psdm-minimal-permission .psdm_error:empty {
  display: none;
}

.psdm-minimal-permission p {
  margin: 0;
}

.psdm-minimal-input {
  padding: 12px 16px;
  border: 1px solid gray;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  transition: all 0.2s;
}

.psdm-minimal-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.psdm-minimal-button {
  width: 100%;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  margin-top: 6px;
}

.psdm-minimal-button:hover {
  opacity: 0.9;
}

.psdm-minimal-bypass {
  margin-top: 16px;
  font-size: 0.85em;
  color: #9ca3af;
  line-height: 1.5;
}

.psdm-minimal-bypass p {
  margin: 0;
}

@media (max-width: 767px) {
  .psdm-minimal-template {
    padding: 28px 24px 24px;
  }

  .psdm-minimal-title {
    font-size: 1.25em;
    padding-right: 0;
  }
}

@media (max-width: 479px) {
  .psdm-minimal-template {
    padding: 24px 16px 20px;
  }

  .psdm-minimal-close {
    right: 12px;
    top: 12px;
  }

  .psdm-minimal-header {
    margin-bottom: 16px;
  }
}
