.website-editor {
  width: min(900px, calc(100% - 30px));
  overflow-x: hidden;
}

.website-editor .dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
}

.website-editor-body {
  padding: 24px 27px;
  min-width: 0;
}

.website-editor-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 24px;
  border: 1px solid var(--line, #e2e9e9);
  border-radius: 10px;
  background: var(--teal-soft, #e8f4ef);
}

.website-editor-template small {
  display: block;
  margin-top: 4px;
}

.website-editor-group,
.website-editor-section,
.website-editor-item,
.website-editor-choices {
  min-width: 0;
  margin: 0 0 22px;
  padding: 17px;
  border: 1px solid var(--line, #e2e9e9);
  border-radius: 10px;
}

.website-editor-group > legend,
.website-editor-section > legend,
.website-editor-item > legend,
.website-editor-choices > legend {
  padding: 0 7px;
  font-weight: 650;
}

.website-editor-group h3,
.website-editor-pages > h3 {
  margin-bottom: 8px;
}

.website-editor .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.website-editor-counter {
  display: block;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.website-editor-counter.error {
  color: var(--red, #b24c46);
}

.website-editor-page {
  margin-bottom: 14px;
  border: 1px solid var(--line, #e2e9e9);
  border-radius: 11px;
  overflow: hidden;
}

.website-editor-page > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 16px;
  cursor: pointer;
  background: #f5f8f6;
}

.website-editor-page > summary::before {
  content: '＋';
  color: var(--teal, #157567);
}

.website-editor-page[open] > summary::before {
  content: '−';
}

.website-editor-page > summary strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.website-editor-page > summary .website-editor-counter {
  font-size: 11px;
}

.website-editor-page-body {
  padding: 17px;
}

.website-editor-path {
  display: block;
  margin: 7px 0 22px;
  overflow-wrap: anywhere;
}

.website-editor-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  margin-top: 16px;
  margin-bottom: 10px;
}

.website-editor-choice {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.website-editor-choice input {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.website-editor-choice span {
  min-width: 0;
}

.website-editor-choice:has(input:disabled) {
  color: var(--muted, #6d8189);
}

.website-editor-item {
  margin: 18px 0 0;
  background: #fafcfb;
}

.website-editor-item .text-button {
  margin-top: 12px;
}

.website-editor-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.website-editor-error:empty {
  display: none;
}

.website-editor-missing {
  padding: 10px;
  border-radius: 8px;
  color: var(--amber, #916515);
  background: #fcf7ea;
  font-size: 12px;
}

.website-editor-error {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid #edcdc5;
  border-radius: 8px;
  background: #fff1ee;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .website-editor {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .website-editor-body,
  .website-editor .dialog-head {
    padding: 17px;
  }

  .website-editor .form-grid,
  .website-editor-choices {
    grid-template-columns: minmax(0, 1fr);
  }

  .website-editor-template {
    align-items: flex-start;
    flex-direction: column;
  }

  .website-editor-group,
  .website-editor-section,
  .website-editor-page-body {
    padding: 13px;
  }

  .website-editor .full {
    grid-column: 1 / -1;
  }

  .website-editor .form-footer {
    flex-direction: column-reverse;
  }

  .website-editor .form-footer button {
    width: 100%;
  }
}
