.editor-app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.editor-topbar {
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 80;
}

.editor-topbar > span {
  color: var(--muted);
  font-weight: 700;
}

.editor-topbar > strong {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  background: var(--green-bg);
  color: var(--green);
  font-size: 12px;
}

.editor-topbar__actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  min-height: calc(100vh - 68px);
}

.editor-sidebar,
.editor-inspector {
  padding: 18px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: auto;
  max-height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
}

.editor-inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.editor-main {
  padding: 22px;
  overflow: hidden;
}

.editor-panel-title {
  margin: 10px 0 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.editor-pages,
.editor-add,
.editor-versions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-pages button,
.editor-add button,
.editor-versions button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--r-alert);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.editor-pages button.is-active {
  border-color: var(--green);
  background: var(--green-bg);
}

.editor-pages span,
.editor-versions strong {
  display: block;
  font-weight: 800;
}

.editor-pages small,
.editor-versions span,
.editor-add button {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.editor-add button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.editor-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.editor-page-head > div:first-child {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.editor-seo {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  margin-bottom: 18px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-field--inline {
  min-width: 240px;
}

.editor-field input,
.editor-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--r-field);
  padding: 12px 13px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.editor-field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.editor-field small {
  color: var(--faint);
  font-weight: 700;
}

.editor-blocks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.editor-block {
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  background: var(--paper);
  overflow: hidden;
}

.editor-block.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 60, 47, 0.1);
}

.editor-block__bar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #fbfcfb;
}

.editor-block__bar button {
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.editor-block__bar div {
  display: flex;
  gap: 4px;
}

.editor-block__bar div button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.editor-block__bar div button:hover {
  background: var(--green-bg);
  color: var(--green);
}

.editor-block__bar [data-editor-move$=":1"] [data-lucide] {
  transform: rotate(180deg);
}

.editor-preview {
  padding: 22px;
  background: var(--paper);
}

.editor-preview h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.6px;
}

.editor-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.editor-preview--hero {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 20px;
  align-items: center;
}

.editor-preview--hero h2 {
  font-size: 34px;
}

.editor-preview__phone {
  height: 220px;
  border-radius: 28px;
  background: var(--green-bg);
  color: var(--green);
  display: grid;
  place-items: center;
}

.editor-preview__buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.editor-preview__buttons span,
.editor-preview--green strong {
  border-radius: var(--r-btn-lg);
  padding: 11px 14px;
  background: var(--green);
  color: var(--on-green);
  font-size: 13px;
  font-weight: 800;
}

.editor-preview__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.editor-preview__grid div,
.editor-preview__faq,
.editor-preview__legal {
  border: 1px solid var(--line);
  border-radius: var(--r-alert);
  padding: 13px;
}

.editor-preview__grid strong,
.editor-preview__faq strong,
.editor-preview__legal strong {
  display: block;
  font-size: 14px;
}

.editor-preview__grid span,
.editor-preview__faq span,
.editor-preview__legal p {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.editor-preview--green {
  background: var(--green);
  color: var(--on-green);
}

.editor-preview--green p {
  color: var(--on-green-muted);
}

.editor-preview--green strong {
  display: inline-block;
  margin-top: 16px;
  background: var(--on-green);
  color: var(--green);
}

.editor-preview--hidden {
  color: var(--faint);
  font-weight: 800;
  background: var(--disabled-field);
}

.editor-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-settings__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.editor-settings__head span {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.editor-settings__head strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.switch input {
  display: none;
}

.switch span {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  display: block;
  position: relative;
}

.switch span::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.editor-site-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-card-lg);
  overflow: hidden;
  background: var(--bg);
  max-height: 68vh;
  overflow-y: auto;
}

.editor-site-preview .site-header,
.editor-site-preview .site-footer {
  display: none;
}

.editor-site-preview--home main {
  padding-bottom: 40px;
}

.editor-empty {
  padding: 32px;
  color: var(--muted);
}

.editor-versions {
  margin-top: 24px;
}

.editor-versions p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .editor-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .editor-inspector {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .editor-layout,
  .editor-seo,
  .editor-preview--hero {
    grid-template-columns: 1fr;
  }

  .editor-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-topbar {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .editor-topbar__actions {
    width: 100%;
    margin-left: 0;
  }

  .editor-page-head {
    flex-direction: column;
  }
}
