.ctor-body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 20px;
  color: #1a1d21;
  background: linear-gradient(165deg, #eef2f7 0%, #e8eef5 45%, #f4f6f9 100%);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

.ctor-wrap {
  max-width: 960px;
  margin: 0 auto;
}

.ctor-header {
  margin-bottom: 20px;
}

.ctor-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0d2b3a;
}

.ctor-lead {
  margin: 0;
  color: #3d4650;
  max-width: 52em;
}

.ctor-code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: #e8ecf1;
  padding: 2px 6px;
  border-radius: 4px;
}

.ctor-err {
  background: #fde8e8;
  color: #8a1c1c;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.ctor-status {
  min-height: 1.2em;
  color: #2e8b57;
  font-size: 14px;
  margin: 0 0 12px;
}

.ctor-muted {
  color: #5c6570;
  font-size: 13px;
}

.ctor-hint {
  margin: 0 0 12px;
}

.ctor-panel {
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15, 34, 58, 0.05);
}

.ctor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.ctor-row:last-child {
  margin-bottom: 0;
}

.ctor-row--tools,
.ctor-row--copy,
.ctor-row--move {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef1f5;
}

.ctor-row--move {
  border-bottom: none;
  padding-bottom: 0;
}

.ctor-label {
  font-weight: 600;
  font-size: 13px;
  color: #3d4650;
  min-width: 160px;
}

.ctor-select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cfd6de;
  min-width: 200px;
  background: #fff;
}

.ctor-select--wide {
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

.ctor-btn {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cfd6de;
  background: #f5f7fa;
  color: #1a1d21;
  cursor: pointer;
}

.ctor-btn:hover {
  background: #eef2f7;
}

.ctor-btn--primary {
  background: #2fc6f6;
  border-color: #1eb8eb;
  color: #0d2b3a;
}

.ctor-btn--primary:hover {
  filter: brightness(0.97);
}

.ctor-btn--danger {
  background: #fff0f0;
  border-color: #e8b4b4;
  color: #8a1c1c;
}

.ctor-btn--small {
  font-size: 13px;
  padding: 6px 10px;
}

.ctor-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.ctor-steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.ctor-h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0d2b3a;
}

.ctor-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ctor-step-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e4e9ef;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fafbfd;
}

.ctor-step-row--dragover {
  outline: 2px dashed #2fc6f6;
  background: #f0fbff;
}

.ctor-drag-handle {
  cursor: grab;
  color: #8a939c;
  font-size: 18px;
  user-select: none;
  padding: 4px;
}

.ctor-step-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.ctor-step-summary {
  min-width: 0;
}

.ctor-step-title {
  font-weight: 600;
  color: #0d2b3a;
}

.ctor-step-meta {
  font-size: 12px;
  color: #5c6570;
  margin-top: 2px;
}

.ctor-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* display:flex перебивает стандартное [hidden] в части встроенных браузеров — явно скрываем */
.ctor-modal-backdrop[hidden] {
  display: none !important;
  pointer-events: none;
  visibility: hidden;
}

.ctor-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 58, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
  z-index: 1000;
  visibility: visible;
}

.ctor-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  margin-top: 24px;
}

.ctor-modal-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  color: #0d2b3a;
}

.ctor-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ctor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #3d4650;
}

.ctor-input,
.ctor-textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid #cfd6de;
  border-radius: 8px;
}

.ctor-textarea {
  resize: vertical;
  min-height: 100px;
}

.ctor-image-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.ctor-img-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid #e4e9ef;
}

.ctor-image-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.ctor-fieldset {
  border: 1px solid #e4e9ef;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}

.ctor-fieldset legend {
  font-weight: 600;
  font-size: 13px;
  padding: 0 6px;
}

.ctor-fieldset-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
}

.ctor-fieldset-hint code {
  font-size: 11px;
  background: #f0f3f7;
  padding: 1px 5px;
  border-radius: 4px;
}

.ctor-check--block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 500;
}

.ctor-actions-editor {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.ctor-action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #e4e9ef;
  border-radius: 8px;
  background: #fafbfd;
}

.ctor-action-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ctor-action-type {
  font: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cfd6de;
  min-width: 160px;
}

.ctor-action-remove {
  margin-left: auto;
}

.ctor-action-label,
.ctor-action-tab,
.ctor-action-path {
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  width: 100%;
}

.ctor-action-hint {
  font-size: 11px;
  color: #5c6570;
  margin: 0;
}

.ctor-fieldset .ctor-check {
  display: flex;
  margin-bottom: 8px;
}

.ctor-subfield {
  margin-top: 10px;
}

.ctor-field-filter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  margin: 0 0 8px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  background: #fafbfc;
}

.ctor-field-filter:focus {
  outline: none;
  border-color: #2fc6f6;
  background: #fff;
}

.ctor-comp-fields {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.ctor-comp-fields li.ctor-comp-field-li {
  margin-bottom: 10px;
}

.ctor-comp-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ctor-comp-field-row .ctor-select {
  flex: 1;
  min-width: 0;
}

.ctor-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eef1f5;
}
