.cms-extra-social {
  width: auto;
  min-height: 36px;
  padding-inline: 8px;
  font-size: .875rem;
}

.cms-form-success {
  padding-block: 12px;
}

.cms-editor {
  position: fixed;
  z-index: 101;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  border: 1px solid #687586;
  border-radius: 8px;
  background: #16202d;
}

.cms-editor a,
.cms-editor summary,
.cms-block-marker,
.cms-dialog button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 12px;
  border: 0;
  border-radius: 5px;
  background: #28445f;
  color: #fff;
  font: 600 .875rem/1.2 system-ui, sans-serif;
}

.cms-editor a:hover,
.cms-editor summary:hover,
.cms-block-marker:hover,
.cms-dialog button:hover {
  background: #345b7d;
  color: #fff;
}

main [data-cms-block] {
  position: relative;
  outline: 1px dashed #78aee2;
  outline-offset: -1px;
}

.cms-block-marker {
  position: absolute;
  z-index: 15;
  top: 8px;
  right: 8px;
}

.cms-editor summary {
  cursor: pointer;
}

.cms-block-picker ul {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  width: min(350px, calc(100vw - 16px));
  max-height: 45dvh;
  margin: 0;
  padding: 4px;
  overflow: auto;
  border: 1px solid #687586;
  border-radius: 8px;
  background: #16202d;
  list-style: none;
}

.cms-block-picker a {
  justify-content: flex-start;
  width: 100%;
  margin-block: 2px;
}

.cms-dialog {
  position: fixed;
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(12px, 3vw, 24px);
  overflow: auto;
  border: 1px solid #687586;
  border-radius: 12px;
  background: #16202d;
  color: #fff;
  font: 400 1rem/1.4 system-ui, sans-serif;
}

.cms-dialog::backdrop {
  background: rgb(0 0 0 / 65%);
}

.cms-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.cms-dialog textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  resize: vertical;
  border: 1px solid #687586;
  border-radius: 5px;
  background: #0f1723;
  color: #fff;
}

.cms-source-editor textarea {
  min-height: min(50dvh, 500px);
  font: .875rem/1.5 ui-monospace, monospace;
}

.cms-source-editor summary {
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: underline;
}

.cms-source-editor[open] + .cms-text-fields {
  display: none;
}

.cms-text-fields {
  display: grid;
  gap: 12px;
  max-height: min(50dvh, 500px);
  padding: 4px;
  overflow: auto;
}

.cms-text-fields label span {
  display: block;
  font-size: .875rem;
}

.cms-text-fields textarea {
  font: inherit;
}

.cms-editor-status {
  min-height: 1.4em;
  margin: 8px 0;
}

.cms-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.cms-dialog button:disabled {
  opacity: .5;
}
