html.sps-modal-open {
  overflow: hidden;
}

dialog.sps-dialog {
  box-sizing: border-box;
  width: min(var(--sps-width, 600px), calc(100% - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  inset: 0;
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: var(--sps-radius, 12px);
  background: var(--sps-background, #fff);
  color: #282828;
  box-shadow: 0 16px 56px rgb(0 0 0 / 24%);
}

dialog.sps-dialog:not([open]) { display: none; }
dialog.sps-dialog::backdrop { background: rgb(0 0 0 / var(--sps-overlay, .5)); }
dialog.sps-dialog.sps-position-top { margin-top: 12px; }
dialog.sps-dialog.sps-position-bottom { margin-bottom: 12px; }
dialog.sps-dialog.sps-position-bottom-left { margin: auto auto 12px 12px; }
dialog.sps-dialog.sps-position-bottom-right { margin: auto 12px 12px auto; }

.sps-dialog .sps-controls {
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 49px;
  padding: 3px 6px;
}

.sps-dialog .sps-close {
  all: unset;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 50%;
  background: #f4f4f4;
  color: #282828;
  font: 400 26px/1 system-ui, sans-serif;
  cursor: pointer;
}

.sps-dialog .sps-close:hover { background: #e7e7e7; }
.sps-dialog .sps-close:focus-visible { outline: 2px solid #282828; outline-offset: 2px; }

iframe.sps-frame {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: var(--sps-height, 460px);
  max-height: calc(100vh - 74px);
  max-height: calc(100dvh - 74px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@keyframes sps-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sps-slide { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .sps-dialog[open].sps-animation-fade { animation: sps-fade 180ms ease-out; }
  .sps-dialog[open].sps-animation-slide { animation: sps-slide 210ms ease-out; }
}

#sps-editor .sps-editor-intro { padding: 3px 0 13px; }
#sps-editor .sps-admin-section { border-top: 1px solid #dcdcde; padding: 13px 0 20px; }
#sps-editor .sps-admin-section h3 { margin: 0 0 9px; font-size: 14px; }
#sps-editor .sps-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 4px 16px; }
#sps-editor .sps-field { margin: 6px 0; min-width: 0; }
#sps-editor .sps-field label { display: block; margin-bottom: 4px; font-weight: 600; }
#sps-editor .sps-field select, #sps-editor .sps-field input:not([type="checkbox"]) { max-width: 100%; }
#sps-editor .sps-field textarea, #sps-editor #sps-embed_url { width: 100%; }
#sps-editor #sps-html { font: 13px/1.45 Consolas, Monaco, monospace; }
#sps-editor #sps-preview-status { margin-left: 8px; }
