.page-editor {
  display: grid;
  gap: 16px;
}

.page-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.page-editor__title {
  margin: 0;
  font-size: var(--font-size-xl, 1.125rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary, #1e3c38);
  flex: 1;
  min-width: 160px;
}

.page-editor__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-editor__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle, #e7ece9);
}

.page-editor__tab {
  all: unset;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  font-size: var(--font-size-base, 0.875rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-secondary, #5f6e6a);
  display: inline-flex;
  align-items: center;
  gap: 6px;

  &:focus-visible {
    outline: 2px solid var(--brand-primary, #1e8a6e);
    outline-offset: 2px;
  }
}

.page-editor__tab--active {
  color: var(--brand-primary, #1e8a6e);
  background: var(--surface-muted, #eef2f0);
}

.page-editor__panel {
  min-height: 200px;
}

.page-editor__stack {
  display: grid;
  gap: 14px;
}

.page-editor__explain {
  margin: 0;
  font-size: var(--font-size-sm, 0.8125rem);
  color: var(--text-secondary, #5f6e6a);
}

.page-editor__media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 720px) {
  .page-editor__media-grid {
    grid-template-columns: 1fr;
  }
}

.media-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle, #e7ece9);
  border-radius: 10px;
}

.media-block__label {
  font-size: var(--font-size-sm, 0.8125rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary, #1e3c38);
}

.media-block__preview {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
}

.media-block__actions {
  display: flex;
  gap: 8px;
}

.page-editor__content-block {
  display: grid;
  gap: 8px;
}

.page-editor__content-heading {
  margin: 0;
  font-size: var(--font-size-base, 0.875rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary, #1e3c38);
}

.page-editor__html-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.page-editor__error {
  color: var(--danger, #c0392b);
  font-size: var(--font-size-sm, 0.8125rem);
  margin: 0;
}
